Score:0

Browsers cant open custom URI (x-scheme-handler) via xdg, but it works well from console with xdg-open

br flag

I used xdg to set things up, so my custom URI would open in my custom desktop application. Things seem to work in the console. I tested it using both xdg-open and gio open:

$ xdg-open foobar:id=333
$ gio open foobar:id=444

Both run my script as intended.

When I go to my browser and click a hyperlink with the same URI, first a small dialogue appears to ask if I will allow the website to open xdg-open, and I accept.

enter image description here

Then xdg-desktop-portal appears and says that no apps are available.

enter image description here

I assume clicking Find More in Software wont help me, but would instead take me to the Ubuntu Software Application or similar. But if I do click it, I get:

enter image description here

The behavior is the same for both Firefox and Chromium.

However, magnet links work as expected, after installing Transmission.

Details from gio:

$ gio mime x-scheme-handler/foobar
Default application for “x-scheme-handler/foobar”: foobar.desktop
No registered applications
No recommended applications

Content of foobar.desktop:

[Desktop Entry]
Version=1.0
Name=Foobar Test Handler
GenericName=Foobar
Comment=Just for testing
Icon=/home/jdoe/foobar/icon.png
Path=/home/jdoe/foobar/
Exec=python /home/jdoe/foobar/handler.py %u
Terminal=false
Type=Application
Categories=Utility
MimeType=x-scheme-handler/foobar;

Im running Ubuntu 22.04.1 LTS.

Score:0
cm flag

update your mime handler databases with command

update-desktop-database ~/.local/share/applications
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.