All predicatesShow sourcewww_browser.pl -- Open a URL in the users browser

This library deals with the highly platform specific task of opening a web page. In addition, is provides a mechanism similar to absolute_file_name/3 that expands compound terms to concrete URLs. For example, the SWI-Prolog home page can be opened using:

?- www_open_url(swipl(.)).
Sourcewww_open_url(+Url)
Open URL in running version of the users' browser or start a new browser. This predicate tries the following steps:
  1. If a prolog flag (see set_prolog_flag/2) browser is set and this is the name of a known executable, use this.
  2. On Windows, use win_shell(open, URL)
  3. Find a generic `open' comment. Candidates are xdg-open, open or gnome-open.
  4. If a environment variable BROWSER is set and this is the name of a known executable, use this.
  5. Try to find a known browser.
    @tbd Figure out the right tool in step 3 as it is not uncommon that multiple are installed.
Sourcerun_browser(+Browser, +URL) is det[private]
Open a page using a browser.
Sourcerun_command(+Command, +Args, +Background)[private]
Run OS command Command using Args, silencing the error output because many browsers are rather verbose.
Sourceknown_browser(+FileBaseName, -Compatible)[multifile]
True if browser FileBaseName has a remote protocol compatible to Compatible.
Sourcehas_command(+Command)[private]
Succeeds if Command is in $PATH. Works for Unix systems. For Windows we have to test for executable extensions.
url_path(+Alias, -Expansion) is nondet[private]
Define URL path aliases. This multifile predicate is defined in module user. Expansion is either a URL, or a term Alias(Sub).
Sourceexpand_url_path(+Spec, -URL)
Expand URL specifications similar to absolute_file_name/3. The predicate url_path/2 plays the role of file_search_path/2.
Errors
- existence_error(url_path, Spec) if the location is not defined.