mvo5 / synaptic

The synaptic package manager
GNU General Public License v2.0
160 stars 55 forks source link

Settings --> Preferences: Allow choosing a default web browser for links #52

Open allentiak opened 4 years ago

allentiak commented 4 years ago

As a user, when opening "Settings --> Preferences", I would like to be able to select which browser I use when I click "Visit Homepage" on a package's description pane.

BryanQuigley commented 3 years ago

Why should this be different then your system's default?

From what I can tell synaptic tries - xdg-open, then firefox, then iceweasel, then konqueror.

I did find a case where this doesn't work if you don't have a default browser set (and none of the hardcoded browser paths work) but I don't see a good way to fix that.

allentiak commented 3 years ago

The funny thing is that my DE default browser is not the one that gets executed when I click on links inside Synaptic. And this is the only program I have ever experienced this happens...

Maybe this has anything to do with Debian? (the distro I'm using)

BryanQuigley commented 3 years ago

What version of debian / what DE / what version of synaptic?

What browser is your desktop default? Which browser does Synaptic launch? What browser opens when you run xdg-open https://www.example.com?

allentiak commented 3 years ago

@BryanQuigley Thanks for the follow up!

What version of debian / what DE / what version of synaptic?

Debian "testing". Synaptic 0.90.2. (I have been experienced this since 0.8x, though...)

What browser is your desktop default?

Firefox.

Which browser does Synaptic launch?

Chromium.

What browser opens when you run xdg-open https://www.example.com?

Firefox (my default) :-)

(Another option is that the Debian Chromium packaging could be responsible for this... I can remember only one or two times when this situation has not happen before...)

BryanQuigley commented 3 years ago

I'm also using Debian "testing" - using Xfce DE. Installing Chromium package didn't change my default.

I run Firefox via Flatpak as my default browser: $ xdg-settings get default-web-browser org.mozilla.firefox.desktop

Once I installed Chromium if I go to root (sudo -i) It does seem that Chromium is the "Debian sensible default", but Chromium when run as root just exits with an error.. so that shouldn't be it.

It has to be xdg-open.. so my next thought was pkexec vs sudo for running Synaptic.. but couldn't make it happen there either.

Does it still open in Chromium if you run it without root privs via /usr/sbin/synaptic directly?

allentiak commented 3 years ago

Does it still open in Chromium if you run it without root privs via /usr/sbin/synaptic directly?

Yeap.

BryanQuigley commented 3 years ago

Output of xdg-settings get default-web-browser

What desktop environment are you using?

I'm running out of ideas..: What have you changed with your install? sudo dpkg -V will give us a quick idea. Any chance you can see if it still occurs with a new user?

allentiak commented 3 years ago
% xdg-settings get default-web-browser
chromium.desktop

But, if I do an xdg-open https://www.example.com, the link gets opened by Firefox...

allentiak commented 3 years ago

Hmmm....

allentiak commented 3 years ago

My default Web Browser is Firefox... My default Web Browser is Firefox

allentiak commented 3 years ago

Maybe it's a GNOME bug?

allentiak commented 3 years ago

I'm not sure about how to debug this...

allentiak commented 3 years ago

I mean, all of my other apps use Firefox, so whatever setting Synaptic is looking at, every other app looks somewhere else...

BryanQuigley commented 3 years ago

Thanks to this post I now think I understand: https://groups.google.com/g/linux.debian.user/c/gzGyht5f3_c/m/-uQj9jUsEAAJ

I also experience sometimes a different browser opening then I expect.. but never paid it much attention: xdg-mime query default x-scheme-handler/http (and https) com.brave.Browser.desktop

I'm guessing for you the above says Firefox..

allentiak commented 3 years ago

I'm guessing for you the above says Firefox..

Not really...

% xdg-mime query default x-scheme-handler/http
chromium.desktop
-> % xdg-mime query default x-scheme-handler/https
chromium.desktop

But, assuming synaptic uses xdg-* as the source of it default browser, everything makes sense now.

allentiak commented 3 years ago

I wonder...

BryanQuigley commented 3 years ago

How about: xdg-mime query default text/html xdg-mime query default application/xhtml+xml

Regardless I think the Gnome dialog should change the xdg defaults - I'd start there if you can reproduce fresh. AFAIK there used to be gnome-open, but everything should have moved over to the xdg settings - which to be fair there are 5 of them.

allentiak commented 3 years ago

They point to a visual HTML editor I installed. But if I click on such a file from my Nautilus (GNOME's File Manager), Firefox is the one which is (rightly!) opened.

From what I can see, GNOME doesn't give a care on xdg-*...

% xdg-mime query default text/html
bluegriffon.desktop
% xdg-mime query default application/xhtml+xml
bluegriffon.desktop
allentiak commented 3 years ago

Hmmm... I'm puzzled. My questions from above remain...

  • What do other applications use as "truth source" for the default browser?
  • Should synaptic use what others do?
  • Should I open a bug against the Debian Chromium package? (it seems to be the only one that set this up...)

Actually, my question would be...