Call for testing: native messaging support in the Firefox snap

A feature that is known not to work in Firefox packaged as a snap is Native Messaging. Thanks to the work on a new WebExtensions XDG desktop portal and its integration in Firefox, this is now available for testing if you’re running Ubuntu 22.04 (or the upcoming 22.10).

You will need to switch firefox to the beta or edge channel. Alternatively, you can have the stable and beta versions installed and running in parallel.

Easy instructions:

sudo snap refresh firefox --beta

This was tested with the GNOME Shell integration extension as well as the KeePassXC Browser extension. Testing and feedback with these and other extensions that rely on native messaging to work are very welcome. Let us know which extensions you tested, how you installed the native host connector, and whether the functionality worked as expected, partially, or not at all. Thank you!

12 Likes

(cross-posted on the snapcraft forum)

1 Like

Testing right now!!!

1 Like

Ok, I installed it, went to “extensions.gnome.org”, installed the integration extension, reloaded the page… and got this:

Closed firefox, opened it again, went to extensions.gnome.org, but still the same :’(

1 Like

The console shows this:

And this in the linux console…

I have installed chrome-gnome-shell.

1 Like

Do you have xdg-desktop-portal version 1.14.4-1ubuntu2~22.04.1 ?
It’s currently in jammy-updates, but phased at 40%.
If not, kill the xdg-desktop-portal process and let it respawn automatically, that should fix the problem.

1 Like

I had it updated but not re-launched. Killed it and now the problem seems to be IPv6… I’ll see how to fix it.

EDIT: sorry, it wasn’t IPv6, just read too fast. It’s API:v6

Anyway, it seems to work…

EDIT2: enabling, disabling and updating extensions seem to work fine. Good job!!!

4 Likes

Thanks for the feedback!

1 Like

I have just tested it with Plasma Integration and everything seems to be working so far. Download notifications pop-up as expected and sound/video are integrated in the taskbar.

So far everything seems to be working fine. I’ll keep on testing and if any issues arise I’ll report them here.

3 Likes

Also tested looking up browser tabs in KRunner and it worked. Following the status of downloading long files also work.

All the features I use from Plasma Integration now work as they did in the DEB version. Thanks for everyone involved with this great improvement.

2 Likes

There’s one thing that still does not work in Firefox snap, but I’m not sure it is related to Native Messaging.

In my country government agencies use Physical Digital Tokens that can be used as personal IDs / digital certificates to log into some systems. These tokens worked just fine in the DEB version but they stopped working in the Snap version.

Is this related to native messaging? If not, let me know so I can open a new bug report to discuss this issue. This is a very important feature for governmental agencies where I live.

1 Like

That probably related to PKCS#11 and IIRC the folks already are working on it.

1 Like

[Afaik all of the software here is current stable (except the FF beta ofc), only listing just in case.]

Glad to see progress on this one, thanks to all you devs!

KDE Connect 0.1.7 and Plasma Integration 1.8.1 extensions still not working for me after beta refresh in snap and system restart.

Firefox 104.0b2
KDE 5.24.4 (Frameworks 5.92.0, Qt 5.15.3, Kernel 5.15.0-41 gen(64))
all gdk-related settings in about:config set to 1
xdg-desktop-portal 1.14.4-1ubuntu2~22.04.1
xdg-desktop-portal-kde 5.24.4-0ubuntu1

KDE returns “no devices connected,” Plasma “failed to connect to the native host.”

Running snap run firefox is returning:

mary@penelope-kubuntu:~$ snap run firefox
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
Gtk-Message: 23:21:12.582: Failed to load module "colorreload-gtk-module"
Gtk-Message: 23:21:12.582: Failed to load module "window-decorations-gtk-module"
ATTENTION: default value of option mesa_glthread overridden by environment.
ATTENTION: default value of option mesa_glthread overridden by environment.
amdgpu: os_same_file_description couldn't determine if two DRM fds reference the same file description.
If they do, bad things may happen!
ATTENTION: default value of option mesa_glthread overridden by environment.
ATTENTION: default value of option mesa_glthread overridden by environment.
Missing chrome or resource URL: resource://gre/modules/UpdateListener.sys.mjs
[Parent 12149, Main Thread] WARNING: OnCloseSessionDone error: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: Object does not exist at path “/org/freedesktop/portal/desktop/session/1_119/firefox_com_0xc0dedbad_kdeconnect_chrome_3921261412”: 'glib warning', file /build/firefox/parts/firefox/build/toolkit/xre/nsSigHandlers.cpp:167

** (firefox-beta:12149): WARNING **: 23:21:18.238: OnCloseSessionDone error: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: Object does not exist at path “/org/freedesktop/portal/desktop/session/1_119/firefox_com_0xc0dedbad_kdeconnect_chrome_3921261412”
libva info: VA-API version 1.7.0
libva info: Trying to open /snap/firefox/1624/gnome-platform/usr/lib/x86_64-linux-gnu/dri/radeonsi_drv_video.so
libva info: Found init function __vaDriverInit_1_7
ATTENTION: default value of option mesa_glthread overridden by environment.
libva info: va_openDriver() returns 0
ATTENTION: default value of option mesa_glthread overridden by environment.
amdgpu: os_same_file_description couldn't determine if two DRM fds reference the same file description.
If they do, bad things may happen!
libva info: VA-API version 1.7.0
libva info: Trying to open /snap/firefox/1624/gnome-platform/usr/lib/x86_64-linux-gnu/dri/radeonsi_drv_video.so
libva info: Found init function __vaDriverInit_1_7
ATTENTION: default value of option mesa_glthread overridden by environment.
libva info: va_openDriver() returns 0
libva info: VA-API version 1.7.0
libva info: Trying to open /snap/firefox/1624/gnome-platform/usr/lib/x86_64-linux-gnu/dri/radeonsi_drv_video.so
libva info: Found init function __vaDriverInit_1_7
ATTENTION: default value of option mesa_glthread overridden by environment.
libva info: va_openDriver() returns 0

Again, thank you very much for working to get these kinks ironed out. Looking forward to being able to use these extensions without working around snap! Let me know if I can tell you anything else that might be useful.

1 Like

Thanks for this!

It works for me for gnome-shell-integration, but not for keepassxc-browser. When I installed the Firefox Snap, it copied over my existing Firefox profile with working keepassxc integration, but when starting the snap it cannot connect to keepassxc. I deleted the connection in the keepassxc-browser settings, but now nothing happens when I click “Connect” there to add a new keepassxc connection.

Are there any logs somewhere that I can look at?
I started snap run firefox from the terminal, but it does not print any related messages.

Versions:

  • Firefox Snap 104.0b2-1
  • keepassxc 2.6.6 (Ubuntu apt package)
  • keepassxc-browser 1.8.1
  • xdg-desktop-portal 1.14.4-1ubuntu2~22.04.1 (I killed all processes after the upgrade.)
2 Likes

I tested the 1Password extension with Ubuntu 22.10 and Firefox Snap beta and edge. Both don’t work.

➜ snap run firefox                
Gtk-Message: 20:31:46.089: Failed to load module "xapp-gtk3-module"
Gtk-Message: 20:31:46.089: Failed to load module "appmenu-gtk-module"
Gtk-Message: 20:31:46.089: Failed to load module "appmenu-gtk-module"
Gtk-Message: 20:31:46.159: Failed to load module "canberra-gtk-module"
Gtk-Message: 20:31:46.165: Failed to load module "canberra-gtk-module"
[GFX1-]: glxtest: VA-API test failed: failed to initialise VAAPI connection.
ATTENTION: default value of option mesa_glthread overridden by environment.
ATTENTION: default value of option mesa_glthread overridden by environment.
Gtk-Message: 20:31:50.565: Failed to load module "xapp-gtk3-module"
Gtk-Message: 20:31:50.565: Failed to load module "appmenu-gtk-module"
Gtk-Message: 20:31:50.565: Failed to load module "appmenu-gtk-module"
Gtk-Message: 20:31:50.602: Failed to load module "canberra-gtk-module"
Gtk-Message: 20:31:50.603: Failed to load module "canberra-gtk-module"
[GFX1-]: glxtest: VA-API test failed: failed to initialise VAAPI connection.
ATTENTION: default value of option mesa_glthread overridden by environment.
ATTENTION: default value of option mesa_glthread overridden by environment.
Missing chrome or resource URL: resource://gre/modules/UpdateListener.sys.mjs
[Parent 97295, Main Thread] WARNING: OnCloseSessionDone error: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: Object does not exist at path “/org/freedesktop/portal/desktop/session/1_789/firefox_com_1password_1password_2489659785”: 'glib warning', file /build/firefox/parts/firefox/build/toolkit/xre/nsSigHandlers.cpp:167

** (firefox-beta:97295): WARNING **: 20:32:12.943: OnCloseSessionDone error: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: Object does not exist at path “/org/freedesktop/portal/desktop/session/1_789/firefox_com_1password_1password_2489659785”
[Parent 97295, Main Thread] WARNING: OnCloseSessionDone error: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: Object does not exist at path “/org/freedesktop/portal/desktop/session/1_789/firefox_com_1password_1password_1412382229”: 'glib warning', file /build/firefox/parts/firefox/build/toolkit/xre/nsSigHandlers.cpp:167

** (firefox-beta:97295): WARNING **: 20:33:41.047: OnCloseSessionDone error: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: Object does not exist at path “/org/freedesktop/portal/desktop/session/1_789/firefox_com_1password_1password_1412382229”
Missing chrome or resource URL: resource://gre/modules/UpdateListener.sys.mjs
[2022-07-27T23:34:45Z ERROR viaduct::backend::ffi] Missing HTTP status
[2022-07-27T23:34:45Z ERROR viaduct::backend::ffi] Missing HTTP status
[Parent 97295, Main Thread] WARNING: ContentParent: id=7ff9a6a27100 - BlockShutdown: CanSend.: file /build/firefox/parts/firefox/build/dom/ipc/ContentParent.cpp:3595
[Parent 97295, Main Thread] WARNING: ContentParent: id=7ff9a6a27100 - ShutDownProcess: Sent shutdown message.: file /build/firefox/parts/firefox/build/dom/ipc/ContentParent.cpp:1799
[Parent 97295, Main Thread] WARNING: ContentParent: id=7ff98da8d500 - BlockShutdown: CanSend.: file /build/firefox/parts/firefox/build/dom/ipc/ContentParent.cpp:3595
[Parent 97295, Main Thread] WARNING: ContentParent: id=7ff98da8d500 - ShutDownProcess: Sent shutdown message.: file /build/firefox/parts/firefox/build/dom/ipc/ContentParent.cpp:1799
[Parent 97295, Main Thread] WARNING: ContentParent: id=7ff983a8ff00 - BlockShutdown: CanSend.: file /build/firefox/parts/firefox/build/dom/ipc/ContentParent.cpp:3595
[Parent 97295, Main Thread] WARNING: ContentParent: id=7ff983a8ff00 - ShutDownProcess: Sent shutdown message.: file /build/firefox/parts/firefox/build/dom/ipc/ContentParent.cpp:1799
[Parent 97295, Main Thread] WARNING: ContentParent: id=7ff97f2b9400 - BlockShutdown: CanSend.: file /build/firefox/parts/firefox/build/dom/ipc/ContentParent.cpp:3595
[Parent 97295, Main Thread] WARNING: ContentParent: id=7ff97f2b9400 - ShutDownProcess: Sent shutdown message.: file /build/firefox/parts/firefox/build/dom/ipc/ContentParent.cpp:1799
[Parent 97295, Main Thread] WARNING: ContentParent: id=7ff9a6a27100 - ShutDownProcess: Closing channel.: file /build/firefox/parts/firefox/build/dom/ipc/ContentParent.cpp:1834
[Parent 97295, Main Thread] WARNING: ContentParent: id=7ff9a6a27100 - RemoveShutdownBlockers: file /build/firefox/parts/firefox/build/dom/ipc/ContentParent.cpp:3697
[Parent 97295, Main Thread] WARNING: ContentParent: id=7ff98da8d500 - ShutDownProcess: Closing channel.: file /build/firefox/parts/firefox/build/dom/ipc/ContentParent.cpp:1834
[Parent 97295, Main Thread] WARNING: ContentParent: id=7ff98da8d500 - RemoveShutdownBlockers: file /build/firefox/parts/firefox/build/dom/ipc/ContentParent.cpp:3697
[Parent 97295, Main Thread] WARNING: ContentParent: id=7ff983a8ff00 - ShutDownProcess: Closing channel.: file /build/firefox/parts/firefox/build/dom/ipc/ContentParent.cpp:1834
[Parent 97295, Main Thread] WARNING: ContentParent: id=7ff983a8ff00 - RemoveShutdownBlockers: file /build/firefox/parts/firefox/build/dom/ipc/ContentParent.cpp:3697
[Parent 97295, Main Thread] WARNING: ContentParent: id=7ff97f2b9400 - ShutDownProcess: Closing channel.: file /build/firefox/parts/firefox/build/dom/ipc/ContentParent.cpp:1834
[Parent 97295, Main Thread] WARNING: ContentParent: id=7ff97f2b9400 - RemoveShutdownBlockers: file /build/firefox/parts/firefox/build/dom/ipc/ContentParent.cpp:3697
1 Like

I installed the Firefox beta, but it’s not working with KeePassXC 2.7.1 & keepassxc-browser 1.8.1 either. I get a message of “Error! Not connected to KeePassXC”.

1 Like

I’ve the same problem with the KeePassXC-Browser extension, it says that the key exchange failed. It never prompted for access, despite me copying the native messaging config file.

GNOME Shell worked OK after an “unexpected error” reported and a browser restart.

2 Likes

I can confirm that firefox needed a restart for the GNOME Shell extension to work.

This is related to Native Messaging indeed, but not fully addressed by this work yet. See the corresponding upstream bug report.

1 Like

Others in this thread have reported that Plasma integration works.
Can you run with:

MOZ_LOG=NativeMessagingPortal:5 snap run firefox

and share the output here?

1 Like