How do I find out the user's "preferred web browser", if they're using Gnome desktop environment? (I want to open a webpage, I don't need to know which browser the user prefers.)
Some background: I'm trying to open a browser window (my homepage) with my Java app.
Method 2 works on Windows just fine; and opens a browser on Linux. However, it's the first browser that it finds (in my case, looks for Firefox first). In Gnome desktop environment (e.g. Ubuntu Linux has that by default), you could set your "Preferred Applications" for e-mail, www browsing etc; I believe this information is accesible somewhere. How can I find out which is the user's preferred browser?
In other words: where does Gnome store the "Preferred Browser" setting?
The most portable way to open a file or URL in Linux desktop is xdg-open
.
http://portland.freedesktop.org/xdg-utils-1.0/xdg-open.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With