I have custom links in my personal wiki to do routine tasks on my computer. For example, when I click the URL mysecretprotocol://launch-calculator, Firefox would run ~/.bin/run-from-firefox launch-calculator (a script I wrote) which in turn runs /usr/bin/gnome-calculator. To configure this in Firefox, I opened about:config, created the config option network.protocol-handler.expose.mysecretprotocol, and set it to false.
This worked well for years. However, when I upgraded to Ubuntu 22.04, the custom links stopped working. Now, when I click a custom link, nothing visible happens but this line is added to /var/log/syslog:
May 18 18:30:01 localhost kernel: [76081.618924] audit: type=1400 audit(1652895001.147:1326): apparmor="DENIED" operation="exec" profile="snap.firefox.firefox" name="/run/user/1000/doc/7d7ed56a/run-from-firefox" pid=47023 comm="firefox" requested_mask="x" denied_mask="x" fsuid=1000 ouid=1000
How do I make these custom links work again while still running Firefox as a snap? (I do not want to move to a way of running Firefox that Canonical does not support.)
Related resources:
- network.protocol-handler.expose.(protocol)
- Set custom protocol handler in Firefox?
- xdg-mime
/var/lib/snapd/apparmor/profiles/snap.firefox.firefox
Update: I realized that the Zoom client for Linux does exactly what I want. I click on a Zoom meeting link, it opens a page on the Zoom website, and that page launches the Zoom client (/usr/bin/zoom) without any further interaction, even when Firefox is installed as a snap. (The first time I did this, Firefox prompted me for permission.) How can I do this for my own program?