Flatpak Apps Not Opening Links in (Flatpak) Browser

I experienced this odd issue where Flatpaks couldn’t open links in my default browser when clicking on them. This turned out to be because of whatever reason, these Wine protocols took over what handles opening those links in my browser:

wine-protocol-https.desktop

wine-protocol-http.desktop

No clue why this happened, but I presume that somehow, after installing the staging version of Wine 11.14, it switched to that. If you’re experiencing this niche issue as well, here’s how I fixed it, assuming you’re using a Flatpak browser:

  1. Run ls /var/lib/flatpak/exports/share/applications/
  • This will list all your Flatpak apps, find your browser here.
  • For example, Firefox’s name would be: org.mozilla.firefox.desktop
  • For reference, let’s use that name.
  1. Run these commands:

xdg-mime default [FLATPAK NAME] x-scheme-handler/http
xdg-mime default [FLATPAK NAME] x-scheme-handler/https

Since I’m using Firefox, the command would look like this:

xdg-mime default org.mozilla.firefox.desktop x-scheme-handler/http
xdg-mime default org.mozilla.firefox.desktop x-scheme-handler/https

And there you go! If you wanna make sure the command worked:

xdg-mime query default x-scheme-handler/https
xdg-mime query default x-scheme-handler/http

You should get an output of your Flatpak browser. For the Flatpak version of Firefox that we used before, your output would look like this:

org.mozilla.firefox.desktop
org.mozilla.firefox.desktop

Hopefully this fixes the issue for anyone else running into this in the future!