Using the Eclipse SDK under Linux, there’s an entry in the list of “External web browsers” for “Default system web browser”. How is this default determined?
I set up and selected an entry that calls my own version of xdg-open which is just a wrapper to launch Chromium. But, when I launched a project from the GWT plugin, it defaulted back to “Default system web browser”.
I don’t use a major desktop environment (neither GNOME nor KDE), so I’m unsure how any default would be set. But it would be nicer to set this globally and avoid per-application (or per-plugin) configuration in the future.
Ended up source diving. I wrote and stepped into a simple Eclipse Application that only gets the default browser the way Eclipse (the IDE) itself does (in org.eclipse.ui.internal.browser.SystemBrowserInstance):
Turns out Eclipse identifies my “desktop” as DESKTOP_GIO, because I have the GIO library installed as part of some GNOME dependency. Because it ID’s me as such it calls this libgio function:
According to the docs, GIO applications use the X Desktop Group (XDG) “standard” Shared MIME-info Database to find applications that support a given MIME type.
In my case, I’ve never registered any application as the default handler for text/html, but Eclipse simply chooses the first one returned (which happens to be
winebrowser, since it has awine-extension-html.desktopentry in my~/.local/share/applications/directory).In the end I used:
to add a desktop entry for my custom script, and:
to set it as the default for “html” files.