The pre-installed Firefox browser in Ubuntu 22.04 finally to add back the ability to install Gnome Shell Extensions.
As you may know, Firefox in Ubuntu 22.04 defaults to Snap package that runs in sandbox. It however lacks the feature to exchange messages with native applications. So, you’ll find that the password manager integration (e.g., KeePassXC and 1password) with Firefox does not work. And, there’s no ON/OFF switch when you trying to install extensions from Gnome website.
For those sticking to the default Firefox package in Ubuntu 22.04, the new WebExtensions XDG desktop portal and its Firefox integration is present now to add back the native messaging support, though it’s in Beta stage at the moment for testing!
How to Try it out:
First of all, backup your bookmark, passwords, and other important data from current Firefox package.
1. Open ‘Ubuntu Software’, search for Firefox and go into its installation page. Then, switch to ‘latest/beta‘ channel via the header bar ‘Source’ dropdown-box. Finally, click install it.
Or, simply press Ctrl+Alt+T to open terminal, and run command to switch Firefox from stable to latest beta:
sudo snap refresh firefox --beta
2. Next, run command in terminal (Ctrl+Alt+T) to update the
XDG desktop portal, and also install
sudo apt install xdg-desktop-portal chrome-gnome-shell
3. Now, kill the process of ‘xdg-desktop-portal’ and let it starts automatically. What I did is just log out and back in.
4. Finally, open Firefox web browser and go to extensions.gnome.org. It should pop-up a dialog ask user to grant permission to allow native connection for the website.
After clicking ‘Allow’, and install the browser extension via the ‘Click here to install broswer extension‘ link. You should finally be able to install an extension via the ON/OFF switch.
Skip the warning message ‘Your native host connector do not support following APIs: v6.‘, which also appear in my Google Chrome browser, though the extension install/uninstall function works.
Those using KeePassXC password manager may also install this extension to see if the browser integration works.
Switch back Firefox stable:
To go back the stable version of Firefox as Snap package, either search Firefox in Ubuntu Software and select ‘latest/stable’ channel from source and click install.
Or, run command in a terminal window (Ctrl+Alt+T):
sudo snap refresh firefox --stable
via: Ubuntu Discourse