
www_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(.)).
www_open_url(+Url)- Open URL in running version of the users' browser or start a new
browser. This predicate tries the following steps:
- If a prolog flag (see set_prolog_flag/2)
browseris set and this is the name of a known executable, use this. The flag may be set toCommand-Mode, where mode is one offgorbg, requesting Command to run in foreground or background mode. Default isbg. - Hand the URL to the desktop using desktop_open/2 from library(desktop) if this library is available. On Windows we use win_shell/2 if it is not.
- If a environment variable
BROWSERis set and this is the name of a known executable, use this. - Try to find a known browser.
- If a prolog flag (see set_prolog_flag/2)
known_browser(+FileBaseName, -Compatible)[multifile]- True if browser FileBaseName has a remote protocol compatible to Compatible.
expand_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.