Translations:English -Português (Brasil)
For the list of available alternatives seeWebBrowsers.
The default web browser in Debian's GNOME environment isFirefox.
The default web browser in Debian's KDE environment isKonqueror.
These can be changed to fit your needs. If you prefer a different browser (e.g.Chromium), read below to find out how to change it in your preferred desktop.
Contents
It is similar to settingDefaultPrograms, but has some specifics.
In theDefault Applications section of the GNOME Settings, you can set your default web browser for your user in the "Web" dropdown.
The default GNOME browser can be changed for the whole system by reconfiguring the alternative.
# update-alternatives --config gnome-www-browser
UnderSystem Settings > Applications > Default Applications > Web Browser, change the "Open http and https URLs" setting to "in the following application" and choose your preferred browser from the dropdown list, then apply the change.
To change howhtm orhtml files are handled when they are clicked in your file manager, change the preference underSystem Settings > Applications > File Associations, then search for "html" in the filetype search bar at the top. Under the "text" category, the "html" item lets you set the application preference in order. Move your favorite browser to the top.
You may useSettings > Default Applications > Internet GUI dialog to set default browser.To open it directly from a terminal startxfce4-mime-settings(1).In addition switch to the "Other" tab and set a handler for thetext/html andapplication/xhtml+xml MIME types.
In addition to usual for XDG handlers described inGUI Applications,XFCE has "Debian Sensible Browser" option that relies on thesensible-browser(1) helper script.This option starts a browser configured throughx-www-browser fromDebianAlternatives.Even though this handler is selected by default, it may be better to temporary select another browser and then explicitly switch to the default option back.It should ensure proper handler for applications that do not rely onexo-open(1) orxdg-open(1) tools and parse XDG configuration directly.Otherwise you may face inconsistency
$ xfce4-mime-helper -q WebBrowserdebian-sensible-browser$ readlink -e /usr/bin/x-www-browser/usr/lib/firefox-esr/firefox-esr$ xdg-mime query default x-scheme-handler/httpchromium.desktop$ xdg-mime query default text/xmlchromium.desktop$ xdg-mime query default application/xmlfirefox-esr.desktop
With consistent configurationxfce4-web-browser.desktop should be reported as the XDG handler
$ xdg-mime query default x-scheme-handler/httpsxfce4-web-browser.desktop
XFCE Manual:
https://docs.xfce.org/xfce/xfce4-settings/preferred-apps Preferred Applications
Programs which are not designed for the user's desktop environment do not obey the browser settings of the desktop environment (GNOME or KDE). For example, Thunderbird ignores desktop environment-specific browser settings.The default browser for generic applications can be changed for the whole system by reconfiguring the x-www-browser alternative.
# update-alternatives --config x-www-browser
A browser is started when other applications either open HTTP, HTTPS, etc. links or HTML, XHTML and similar files. It is necessary to configure handlers for these protocols and file types.
GUI applications mostly respect settings frommimeapps.list files residing in~/.config/,/etc/xdg/, and some other locations.Some applications parses these files directly, others, e.g.Chromium usexdg-open(1).Configuration dialogs provided by desktop environment update these files.SeeGUI Applications in DefaultPrograms for more details.
For example, a KDE user may have installed more than one browser:chromium andfirefox-esr,and would like to havefirefox-esr as the default handler.Depending on whether your are going to change preference system-wide or for a specific user,The following entries should be added to the[Default Applications] section of/etc/xdg/mimeapps.list or~/.config/mimeapps.list accordingly.
[Default Applications]x-scheme-handler/http=firefox-esr.desktop;x-scheme-handler/https=firefox-esr.desktop;text/html=firefox-esr.desktop;application/xhtml+xml=firefox-esr.desktop;application/xhtml_xml=firefox-esr.desktop;
An alternative to editing files directly is to usexdg-settings(1) orxdg-mime(1) command line tools.Despitexdg-settings has dedicated subcommands
$ xdg-settings get default-web-browserchromium.desktop$ xdg-settings set default-web-browser firefox-esr.desktop
not all associations may be updated by this command.It may setx-scheme-handler/http protocol handler while e.g. KDE queries fortext/html MIME type. As a result additional commands like the following one may be necessary
xdg-mime default firefox-esr.desktop text/html
Desktop environments may have non-standard configuration options overridingmimeapps.list settings, for example KDE~/.config/kdeglobals may haveBrowserApplication specified in the[General] section. The following command however has a fallback tomimeapps.list:
kreadconfig5 --file kdeglobals --group General --key BrowserApplication
Some tools use value of the$BROWSER environment variable when they are going to open a file or a URL in browser.SeeEnvironmentVariables if you are unsure how to set its value. There are 2 variants how to interpret the value.
The variable contains executable name. A link should be passed as an argument. E.g.sensible-browser(1) and tools calling it follows this convention.
The variable contains colon-separated list of shell commands as candidates. The%s placeholder should be substituted for a link. This a proposal by Eric S. Raymond is implemented e.g. inman(1) andxdvi(1).
At leasturlview(1) implements extended variant, but has a fallback to the simple one.
The extended variant has not gained wide support. A possible issue with it that it is unspecified how to escape special characters in file names and URLs. Just wrapping%s into double or even single quote would cause a security vulnerability since file name or URL may contain quote characters as well.
The BROWSER project, Eric S. Raymond, 2002.
Users and other applications may runwww-browser explicitlyor through thesensible-browser(1) wrapper.To change the browser for console invoked this way use
update-alternatives --config www-browser
This method involves removing all theother browsers installed on the system, so that the desired one remains the only one. Sometimes this is not feasable (multiuser system, dependencies) and is the least elegant.
Any of the previous methods is preferred to this one, but this method can be useful for lightweight systems.
If you're writing a script or application for Debian that needs to be able to open the default browser, your best option is to use thesensible-browser wrapper from thesensible-utils package. This tests the common symlinks (x-www-browser,gnome-www-browser,www-browser, etc.) and chooses the most "sensible" browser out of them.
The environment variableBROWSER can be set to override its selection and force it to always choose your desired browser.
CategoryWebBrowserCategoryNetworkCategorySoftwareCategoryRedundant: merge withWebBrowsers
DefaultWebBrowser (last modified 2025-03-08 11:14:11)