[jitsi-dev] Use default browser on Linux


#1

Hi folks,
could you please add "xdg-open" as last entry to the list of
applications in BrowserLauncherImpl, like this:

@@ -68,7 +68,8 @@ public class BrowserLauncherImpl
                             "epiphany",
                             "mozilla",
                             "netscape",
- "gnome-open"
+ "gnome-open",
+ "xdg-open"
                         };

             Runtime runtime = Runtime.getRuntime();

Jitsi then would launch the system's default browser, assumed that
xdg-open is installed.
Regards,
Julian


#2

Wouldn't it make more sense to have this as the first item? In that way
the default browser would be launched and the others would be in there
as fallback.

Not sure the list makes much sense anyway. gnome-open seems to be a sort
of gnome specific xdg-open, and it is listed after epiphany, which
apparently is a gnome browser. I assume mozilla and netscape are
supposed to point to firefox, but I have no idea on which systems this
would work, certainly not on mine.

I think something like this would make a little bit more sense:
xdg-open, $BROWSER, gnome-open, firefox, konqueror
or something like that.

Regards,
Philipp

Regards,
Philipp

···

On Tue, 07 Jan 2014 22:13:27 +0100 Julian Erhard <Julian.Erhard@yahoo.de> wrote:

Hi folks,
could you please add "xdg-open" as last entry to the list of
applications in BrowserLauncherImpl, like this:

@@ -68,7 +68,8 @@ public class BrowserLauncherImpl
                             "epiphany",
                             "mozilla",
                             "netscape",
- "gnome-open"
+ "gnome-open",
+ "xdg-open"
                         };

             Runtime runtime = Runtime.getRuntime();

Jitsi then would launch the system's default browser, assumed that
xdg-open is installed.
Regards,
Julian


#3

Boris has a patch ready that makes this list configurable and puts xdg-open first. Should soon be in the nightlies.

Freundliche Grüsse,
Ingo Bauersachs

-- Sent from my tablet

···

On 07.01.2014, at 23:00, "Philipp Überbacher" <murks@tuxfamily.org> wrote:

On Tue, 07 Jan 2014 22:13:27 +0100 > Julian Erhard <Julian.Erhard@yahoo.de> wrote:

Hi folks,
could you please add "xdg-open" as last entry to the list of
applications in BrowserLauncherImpl, like this:

@@ -68,7 +68,8 @@ public class BrowserLauncherImpl
                            "epiphany",
                            "mozilla",
                            "netscape",
- "gnome-open"
+ "gnome-open",
+ "xdg-open"
                        };

            Runtime runtime = Runtime.getRuntime();

Jitsi then would launch the system's default browser, assumed that
xdg-open is installed.
Regards,
Julian

Wouldn't it make more sense to have this as the first item? In that way
the default browser would be launched and the others would be in there
as fallback.

Not sure the list makes much sense anyway. gnome-open seems to be a sort
of gnome specific xdg-open, and it is listed after epiphany, which
apparently is a gnome browser. I assume mozilla and netscape are
supposed to point to firefox, but I have no idea on which systems this
would work, certainly not on mine.

I think something like this would make a little bit more sense:
xdg-open, $BROWSER, gnome-open, firefox, konqueror
or something like that.

Regards,
Philipp

Regards,
Philipp

_______________________________________________
dev mailing list
dev@jitsi.org
Unsubscribe instructions and other list options:
http://lists.jitsi.org/mailman/listinfo/dev


#4

Well, "xdg-open" has to be the last item in the list, because otherwise
it would be overridden, as you can see by looking at the for-loop:

for (String b : browsers)
    if (runtime.exec(new String[] { "which", b }).waitFor() == 0)
                    browser = b;

So the last entry in the list that will be found is going to get
executed.
If you want to use the first installed application-entry, i.e. put
"xdg-open" on top of the list, you would have to change the loop to
something like:

for (String b : browsers){
        iff (runtime.exec(new String[] { "which", b }).waitFor() == 0){
                    browser = b;
        break;
  }
}

Regards,
Julian

···

Am Mittwoch, den 08.01.2014, 07:20 +0100 schrieb Ingo Bauersachs:

Boris has a patch ready that makes this list configurable and puts xdg-open first. Should soon be in the nightlies.

Freundliche Grüsse,
Ingo Bauersachs

-- Sent from my tablet

> On 07.01.2014, at 23:00, "Philipp Überbacher" <murks@tuxfamily.org> wrote:
>
> On Tue, 07 Jan 2014 22:13:27 +0100 > > Julian Erhard <Julian.Erhard@yahoo.de> wrote:
>
>> Hi folks,
>> could you please add "xdg-open" as last entry to the list of
>> applications in BrowserLauncherImpl, like this:
>>
>> @@ -68,7 +68,8 @@ public class BrowserLauncherImpl
>> "epiphany",
>> "mozilla",
>> "netscape",
>> - "gnome-open"
>> + "gnome-open",
>> + "xdg-open"
>> };
>>
>> Runtime runtime = Runtime.getRuntime();
>>
>> Jitsi then would launch the system's default browser, assumed that
>> xdg-open is installed.
>> Regards,
>> Julian
>
> Wouldn't it make more sense to have this as the first item? In that way
> the default browser would be launched and the others would be in there
> as fallback.
>
> Not sure the list makes much sense anyway. gnome-open seems to be a sort
> of gnome specific xdg-open, and it is listed after epiphany, which
> apparently is a gnome browser. I assume mozilla and netscape are
> supposed to point to firefox, but I have no idea on which systems this
> would work, certainly not on mine.
>
> I think something like this would make a little bit more sense:
> xdg-open, $BROWSER, gnome-open, firefox, konqueror
> or something like that.
>
> Regards,
> Philipp
>
> Regards,
> Philipp
>
> _______________________________________________
> dev mailing list
> dev@jitsi.org
> Unsubscribe instructions and other list options:
> http://lists.jitsi.org/mailman/listinfo/dev

_______________________________________________
dev mailing list
dev@jitsi.org
Unsubscribe instructions and other list options:
http://lists.jitsi.org/mailman/listinfo/dev


#5

Hello,

···

On 1/8/14 4:16 PM, Julian Erhard wrote:

Well, "xdg-open" has to be the last item in the list, because otherwise
it would be overridden, as you can see by looking at the for-loop:

for (String b : browsers)
    if (runtime.exec(new String[] { "which", b }).waitFor() == 0)
                    browser = b;

So the last entry in the list that will be found is going to get
executed.
If you want to use the first installed application-entry, i.e. put
"xdg-open" on top of the list, you would have to change the loop to
something like:

for (String b : browsers){
        iff (runtime.exec(new String[] { "which", b }).waitFor() == 0){
                    browser = b;
        break;
  }
}

See the proposed patch here, it does exactly what you suggest :slight_smile:
http://lists.jitsi.org/pipermail/dev/2013-December/019449.html

I guess I need to reverse the rest of list to better preserve previous
behavior, though. Thanks.

Regards,
Boris