Launches the default web browser and optionally loads a specified URL.
defaultbrowser [ URL [new-window, new-tab]]
The defaultbrowser command runs the browser launch command that is specified in the DEFAULT_BROWSER environment variable.
If a URL is given as an argument, it loads that URL into the browser. For this to work properly, the browser command must accept a URL as an argument.
The optional new-window and new-tab arguments can be used if the browser that is being launched is the Mozilla web browser.
Both arguments must always be specified with a URL. This URL will then be opened in a new browser window or a new tab. If the browser is not the Mozilla web browser, these two arguments will be ignored.
The main purpose of the defaultbrowser command is to have applications use this command when they need to open a browser to display HTML documents or web-based applications.
This way, a system administrator only needs to change the DEFAULT_BROWSER environment variable when a new browser is installed and all applications will automatically begin using the new browser.
The DEFAULT_BROWSER environment variable should be set to the command that would launch the desired browser.
Include any arguments that must be included after the command to launch a specific URL address.
For example, if the command to launch a browser and open a specific URL is wonderbrowser -r URL, then the DEFAULT_BROWSER environment variable would be set to equal wonderbrowser -r.
If the DEFAULT_BROWSER environment variable is not defined, then the defaultbrowser command runs the Mozilla web browser if it is installed.
defaultbrowser
defaultbrowser http://machine/path/file.html
defaultbrowser http://machine/path/file.html webpage
defaultbrowser http://machine/path/file.html new-window
defaultbrowser http://machine/path/file.html new-tab
Item | Description |
---|---|
/usr/bin/defaultbrowser | The defaultbrowser command |