! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
XFCE doesn't open default browser
Status:
RESOLVED: FIXED

Comments

Description Juan Simón 2019-11-16 10:25:08 CET
Arch Linux 
XFCE 4.14 

I have set Opera as my default web browser in "xfce4-settings-manager" under "Preferred Applications".
But when I press the website link in "About thunar", it opens Firefox instead Opera.
Comment 1 alexxcons editbugs 2019-11-16 23:13:28 CET
Thanks for reporting!
Thunar uses "gtk_show_about_dialog" for its about dialog. Like that instead of "exo-open", some gtk default will be used to open the URL.
I dont know where the gtk default browser can be set .. possibly the default xdg browser is used ?
What is the outcome of "xdg-settings get default-web-browser" for you ?
Does it help to set it to Firefox ?
xdg-settings set default-web-browser firefox-esr.desktop

If setting the xdg default helps, I guess "Preferred Applications" as well should set the xdg default browser, not only the default for "exo-open"
Comment 2 Juan Simón 2019-11-17 11:34:53 CET
Created attachment 9260 
browser selector in "Preferred applications"
Comment 3 Juan Simón 2019-11-17 11:36:54 CET
I think that the applications of the XFCE environment should respect, more than any other, what is indicated in "xfce4-settings-manager".

🗹 "exo-open https://docs.xfce.org/xfce/thunar/start" opens my default browser
🗹 "xdg-settings get default-web-browser" shows my default browser: "opera.desktop"
 
I don't know if it has anything to do with this but when I open the browser selector in "Preferred Applications" I get 2 entries for Opera (see attachment 9260 ).

$ locate opera.desktop                               
/home/juan/.local/share/xfce4/helpers/opera.desktop
/usr/share/applications/opera.desktop
Comment 4 Theo Linkspfeifer editbugs 2019-11-17 20:44:14 CET
I tried to reproduce this issue, but it worked just fine here. Preferred web browser was set to "Opera Browser".

$ cat ~/.config/xfce4/helpers.rc 
WebBrowser=opera-browser

$ xdg-settings get default-web-browser
opera-browser.desktop

Xubuntu 19.10
Comment 5 Juan Simón 2019-11-18 10:01:14 CET
$ cat ~/.config/xfce4/helpers.rc 
MailReader=custom-MailReader
TerminalEmulator=xfce4-terminal
WebBrowser=opera

$ xdg-settings get default-web-browser
opera.desktop

$ locate \.desktop | grep -i opera
/home/juan/.local/share/xfce4/helpers/opera.desktop
/usr/share/applications/opera.desktop
/usr/share/xfce4/helpers/opera-browser.desktop

I have uninstalled Opera, reinstalled it and selected it as a favorite. It keeps failing.
When I open the browser selector in "Preferred Applications" I get 2 entries for Opera: "Navegador web Opera" (/usr/share/xfce4/helpers/opera-browser.desktop) and "Opera" (/usr/share/applications/opera.desktop).

/usr/share/xfce4/helpers/opera-browser.desktop is installed in Arch Linux with the "exo" package. 
But the correct .desktop file is the one that installs the Opera package: /usr/share/applications/opera.desktop

I have changed the title of the error and raised its "severity" and "priority" because the problem is more general. When I click the middle mouse button on a URL in xfce4-terminal it also opens Firefox instead of Opera.
Comment 6 Juan Simón 2019-11-18 10:07:57 CET
If I uninstall Firefox, it works well. But if I reinstall it again, XFCE insists on opening Firefox as the default browser.
Comment 7 alexxcons editbugs 2019-11-18 11:24:16 CET
Moving to exo, since it looks like it is not a thunar problem
Comment 8 Juan Simón 2019-11-18 19:53:14 CET
I don't sure if it's exo the responsible: "exo-open --launch WebBrowser" opens Opera and "exo-open https://docs.xfce.org/xfce/thunar/start" opens my default browser
Comment 9 Juan Simón 2019-11-18 20:03:29 CET
I've done another test by changing the default browser to Chromium and it doesn't respect it either. Keep opening Firefox.
Comment 10 Theo Linkspfeifer editbugs 2019-11-18 20:40:51 CET
$ xdg-mime query default x-scheme-handler/https 
exo-web-browser.desktop

Which web browser does "xdg-open https://docs.xfce.org/xfce/thunar/start" open?
Comment 11 Juan Simón 2019-11-19 10:15:54 CET
$ xdg-mime query default x-scheme-handler/https
firefox.desktop

but "xdg-open https://docs.xfce.org/xfce/thunar/start" opens Opera.
Comment 12 Juan Simón 2019-11-19 10:28:28 CET
$ cat .config/mimeapps.list
[Default Applications]
text/plain=mousepad.desktop
x-scheme-handler/http=firefox.desktop
x-scheme-handler/https=firefox.desktop
x-scheme-handler/ftp=firefox.desktop
x-scheme-handler/chrome=firefox.desktop
image/jpeg=eog.desktop
audio/flac=audacious.desktop
audio/aac=audacious.desktop
audio/ac3=audacious.desktop
audio/mp2=audacious.desktop
video/ogg=mpv.desktop
video/x-theora+ogg=mpv.desktop
application/pdf=org.gnome.Evince.desktop
application/x-shellscript=mousepad.desktop
video/mp4=mpv.desktop
image/png=eog.desktop
video/x-ms-wmv=mpv.desktop
video/quicktime=mpv.desktop
video/mpeg=mpv.desktop
application/x-alpm-package=pamac-installer.desktop
application/xhtml+xml=opera.desktop
text/html=opera.desktop

[Added Associations]
text/plain=mousepad.desktop;
x-scheme-handler/http=exo-web-browser.desktop;
x-scheme-handler/https=exo-web-browser.desktop;
x-scheme-handler/ftp=firefox.desktop;
x-scheme-handler/chrome=firefox.desktop;
image/png=org.gnome.gThumb.desktop;gimp.desktop;ristretto.desktop;eog.desktop;
image/jpeg=org.gnome.gThumb.desktop;gimp.desktop;ristretto.desktop;eog.desktop;
audio/flac=audacious.desktop;
audio/aac=audacious.desktop;
audio/ac3=audacious.desktop;
audio/mp2=audacious.desktop;
video/ogg=mpv.desktop;
video/x-theora+ogg=mpv.desktop;
x-scheme-handler/mailto=exo-mail-reader.desktop;
application/pdf=masterpdfeditor5.desktop;org.gnome.Evince.desktop;org.pwmt.zathura-pdf-mupdf.desktop;qpdfview.desktop;
application/x-shellscript=mousepad.desktop;
video/mp4=mpv.desktop;
application/xml=atom.desktop;firefox.desktop;mousepad.desktop;
video/x-ms-wmv=mpv.desktop;
video/quicktime=mpv.desktop;
application/vnd.comicbook+zip=org.pwmt.zathura.desktop;org.pwmt.zathura-pdf-poppler.desktop;
application/ram=mpv.desktop;
video/mpeg=mpv.desktop;
application/x-alpm-package=engrampa.desktop;pamac-installer.desktop;
application/x-zstd-compressed-tar=xarchiver.desktop;engrampa.desktop;
application/x-7z-compressed=xarchiver.desktop;
application/zip=xarchiver.desktop;
image/tiff=org.gnome.gThumb.desktop;eog.desktop;gimp.desktop;
application/x-trash=mousepad.desktop;
application/xhtml+xml=opera.desktop;
text/html=opera.desktop;

I have deleted this file and ".local/share/applications/mimeapps.list". Now it works well but this should be an automatic process when I make the change in xfce4-settings-manager.

However, although it works (at least since XFCE applications) "xdg-mime" now shows that the default browser is Chromium:
$ xdg-mime query default x-scheme-handler/http   
chromium.desktop

$ xdg-mime query default x-scheme-handler/https
chromium.desktop
Comment 13 Theo Linkspfeifer editbugs 2019-11-19 13:18:33 CET
https://git.xfce.org/xfce/exo/tree/exo-helper/exo-helper.c#n800

Exo only adds its entries to the "Added Associations" category, but entries in the "Default" category have higher priority.
Comment 14 Maurizio Galli 2020-01-20 10:10:48 CET
*** Bug 16390 has been marked as a duplicate of this bug. ***
Comment 15 Maurizio Galli 2020-01-24 11:22:56 CET
Created attachment 9399 
mimeapps.list patch

I have a proposal for a patch that would fix the behavior through the mimeapps.list file. 

It's not perfect, because it just sets exo applications (e.g exo-web-browser.desktop, exo-mail-reader.desktop, etc) as [Default Applications]

However some applications like Firefox, Thunderbird and Evolution would not be able to identify themselves as being set as defaults  since they don't read the helpers.rc file. Depending on how the distro sets them up they might prompt a dialog asking the user to make them Default and as consequence change mimeapps.list with their own desktop file instead of the exo one,  if the user chooses to answer "yes".
Comment 16 Maurizio Galli 2020-01-29 06:02:58 CET
> However some applications like Firefox, Thunderbird and Evolution would not
> be able to identify themselves as being set as defaults  since they don't
> read the helpers.rc file. Depending on how the distro sets them up they
> might prompt a dialog asking the user to make them Default and as
> consequence change mimeapps.list with their own desktop file instead of the
> exo one,  if the user chooses to answer "yes".

To clarify the above: 
Even if mimeapps.list is modified by another application, i.e Firefox, Evolution, Thunderbird, etc, every time you select a web browser or mail client in "Preferred Applications", exo will set again the appropriate application in mimeapps.list.
Comment 17 Sean Davis editbugs 2020-03-03 11:55:18 CET
Thanks for the patch. Applied at https://git.xfce.org/xfce/exo/commit/?id=8141be8d3fef7b5fe596cc77cdb5bf8aac477a1b

Bug #16187

Reported by:
Juan Simón
Reported on: 2019-11-16
Last modified on: 2020-03-03
Duplicates (1):
  • 16390 exo-preferred-applications not properly setting mime types

People

Assignee:
Xfce Bug Triage
CC List:
5 users

Version

Version:
unspecified

Attachments

browser selector in "Preferred applications" (36.49 KB, image/png)
2019-11-17 11:34 CET , Juan Simón
no flags
mimeapps.list patch (1.53 KB, patch)
2020-01-24 11:22 CET , Maurizio Galli
no flags

Additional information