URLs in applications open in Text Editor instead of Firefox

Installed Manjaro Gnome. I have had this issue for a while and wonder if this is “by design” because I do not believe there is a solution for it.

Any application that needs to open a website, for a help page or to login, opens Text Editor instead, showing me html/php code instead of the website.

I believe this is because by default, such links are actually .html or .php or similar files, embedded within the applications. A good example is the OwnCloud or NextCloud Desktop Client, easy to test.

But the OS should know these are web links and should be opened in Firefox.

As a workaround, I used context menu > Open With on a .html file, then selected Firefox as a default. Unfortunately, now Firefox has become the default application for all plain text files!

How is this suppose to work on Manjaro Gnome?

Hi @zilexa,

I believe this is because of a misconfigured Mimetype database (or whatever it’s called.)

Please see

https://wiki.archlinux.org/title/XDG_MIME_Applications

…for more information.

Edit:

The file is located at ~/.config/mimeapps.list and you’ll have to configure HTML files to open with your browser.

1 Like

Thanks, unfortunately, the issue is a bit more complicated, I have pinpointed it now.

By default, there is no issue. Applications indeed open URLs in Firefox correctly.
However, when I copy/paste the firefox.desktop file to my user profile with the purpose of replacing its 2 context menu actions (New Window and Private Window) with launching 2 different profiles, so that I can easily launch one of those profiles, - without modifying anything else (!), urls open in text editor.

I like my Firefox shortcut to have 2 profiles in its shortcut context menu. How can I do this without breaking the http/https association?

My exact steps to reproduce this and test it thouroughly:

  1. Open Owncloud Client, add a url, hit Next, hit Click here.. notice the browser opens.
  2. Copy file /usr/share/applications/firefox.desktop to $HOME/.local/share/applications/firefox.desktop
  3. In Text Editor open $HOME/.local/share/applications/firefox.desktop and Replace Actions=new-window;new-private-window; with Actions=new-window;Profilename1;Profilename2;
  4. Remove the section [Desktop Action new-private-window] and its content.
  5. Add the following 2 sections
[Desktop Action Profile1name]
Name=start Profile1name's Firefox
Exec=firefox -P Profile1name -no-remote

[Desktop Action Profile2name]
Name=start Profile2name's Firefox
Exec=firefox -P Profile2name -no-remote
  1. Log out and back in. Open Arc menu, find Firefox, open its context menu, the 3 actions should be there and you can directly launch a profile.

  2. Open Owncloud Client, add a url, hit Next, hit Click here.. notice Text Editor opens! ← the issue.

  3. Remove the file $HOME/.local/share/applications/firefox.desktop , log out and back in, perform step 7 again and notice Firefox opens.

This means I cannot have my own Firefox shortcut, it will break some associations. How do I solve this?
@linux-aarhus Notice I did not touch the MimeType= section of the default firefox.desktop file, it is still there in the $HOME/.local/share/applications/firefox.desktop file. I even tried the command xdg-mime default "$HOME/.local/share/applications/firefox.desktop" x-scheme-handler/https also for http, made no difference.

I now also notice, with that customized .desktop file in my user folder, Settings > Default Applications no longer shows a browser, it is greyed out!
Somehow the OS believes there is no browser installed when I copy the .desktop file to the user folder.

While I haven’t done it, I still believe it can be done with a mimetype in ~/.config/mimeapps.list.

The following command partly fixes it:

xdg-settings set default-web-browser firefox.desktop

This adds the following to ~/.config/mimeapps.list:

[Default Applications]
text/html=firefox.desktop
x-scheme-handler/http=firefox.desktop
x-scheme-handler/https=firefox.desktop
x-scheme-handler/about=firefox.desktop
x-scheme-handler/unknown=firefox.desktop

It misses several assocations. When I open Firefox and set it as default from within the browser, the rest is added:

[Added Associations]
x-scheme-handler/chrome=firefox.desktop;
application/x-extension-htm=firefox.desktop;
application/x-extension-html=firefox.desktop;
application/x-extension-shtml=firefox.desktop;
application/xhtml+xml=firefox.desktop;
application/x-extension-xhtml=firefox.desktop;
application/x-extension-xht=firefox.desktop;

[Default Applications]
x-scheme-handler/chrome=firefox.desktop
application/x-extension-htm=firefox.desktop
application/x-extension-html=firefox.desktop
application/x-extension-shtml=firefox.desktop
application/xhtml+xml=firefox.desktop
application/x-extension-xhtml=firefox.desktop
application/x-extension-xht=firefox.desktop

Seems a bit weird to me this is even necessary when all I do is add an override user shortcut?

So whenever someone creates a Firefox shortcut with their own profiles in context menu, Firefox associations break and they will need to run the following commands to fix this:

    xdg-settings set default-web-browser firefox.desktop
    xdg-mime default firefox.desktop x-scheme-handler/chrome
    xdg-mime default firefox.desktop application/x-extension-htm
    xdg-mime default firefox.desktop application/x-extension-html
    xdg-mime default firefox.desktop application/x-extension-shtml
    xdg-mime default firefox.desktop application/xhtml+xml
    xdg-mime default firefox.desktop application/x-extension-xhtml
    xdg-mime default firefox.desktop application/x-extension-xht