Modified browser launchers in Linux Sys.openURL method.

Added `sensible-browser' as the first browser launcher option, even before `xdg-open'.
`sensible-browser' tries to open an URL using the preferred web browser, while `xdg-open' just to open a resource (not just an URL) with the preferred application.
Since the method is called openURL and a URL (Uniform Resource Locator) is a web address, `sensible-browser' fits the functionality better.
A notable difference would be calling Sys.openURL('localhost').
Since `localhost' has no leading `http://', `xdg-open' would try to open a `localhost' file and fail, while `sensible-browser' would launch the appropriate browser.

While `sensible-browser' is particular of Debian-based systems and is not as common as xdg-open, this does not negatively affect systems that do not have `sensible-browser':
Were it not present in the system, the rest of the browser launchers would be tried, starting by `xdg-open'.

Added `iceweasel' after `firefox'. `iceweasel' is the Debian fork of Firefox.

Added `google-chrome' and `chromium'. `chromium' is provided in Debian instead of `google-chrome'.
Since the stats in http://www.w3schools.com/browsers/browsers_stats.asp show that Google Chrome is used by more users than Firefox, I put both Google Chrome and Chromium before Firefox in the list.
This change will not affect most of the users, as they will have a preferred browser set up with either `sensible-browser' or `xdg-open'.
This commit is contained in:
Luis Quesada 2013-05-26 18:20:33 +02:00
parent 83763eb873
commit 0e1b392058
1 changed files with 1 additions and 1 deletions

View File

@ -71,7 +71,7 @@ final class LinuxSysImplementation extends J2SESysImplementation {
// Linux may as well resort to pure Java hackery, as there's no Linux native way of doing it
// right anyway.
String[] browsers = {"xdg-open", "firefox", "mozilla", "opera", "konqueror", "nautilus", "galeon", "netscape"};
String[] browsers = {"sensible-browser", "xdg-open", "google-chrome", "chromium", "firefox", "iceweasel", "mozilla", "opera", "konqueror", "nautilus", "galeon", "netscape"};
for ( final String browser : browsers ) {
try {