From 66993665972e237dde89a55e181d17fb9d52f7f9 Mon Sep 17 00:00:00 2001 From: zzz Date: Mon, 22 Jun 2009 19:56:03 +0000 Subject: [PATCH] * Browser Launch: Add sensible-browser, x-www-browser, defaultbrowser, and www-browser in an attempt to launch the user's preferred browser --- .../src/net/i2p/apps/systray/UrlLauncher.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/apps/systray/java/src/net/i2p/apps/systray/UrlLauncher.java b/apps/systray/java/src/net/i2p/apps/systray/UrlLauncher.java index b62b8ae1d..7cce9e59e 100644 --- a/apps/systray/java/src/net/i2p/apps/systray/UrlLauncher.java +++ b/apps/systray/java/src/net/i2p/apps/systray/UrlLauncher.java @@ -155,6 +155,20 @@ public class UrlLauncher { // fall through } + // This debian script tries everything in $BROWSER, then gnome-www-browser and x-www-browser + // if X is running and www-browser otherwise. Those point to the user's preferred + // browser using the update-alternatives system. + if (_shellCommand.executeSilentAndWaitTimed("sensible-browser " + url, 5)) + return true; + + // Try x-www-browser directly + if (_shellCommand.executeSilentAndWaitTimed("x-www-browser " + url, 5)) + return true; + + // puppy linux + if (_shellCommand.executeSilentAndWaitTimed("defaultbrowser " + url, 5)) + return true; + if (_shellCommand.executeSilentAndWaitTimed("opera -newpage " + url, 5)) return true; @@ -173,6 +187,10 @@ public class UrlLauncher { if (_shellCommand.executeSilentAndWaitTimed("galeon " + url, 5)) return true; + // Text Mode Browsers only below here + if (_shellCommand.executeSilentAndWaitTimed("www-browser " + url, 5)) + return true; + if (_shellCommand.executeSilentAndWaitTimed("links " + url, 5)) return true;