Firefox: Support Native Messaging

Currently it is hard to use addons that make use of Native Messaging. I suggest to add a readonly content plug so other snaps can provide the necessary files for Native Messaging. Something like

plugs:
  native_messaging_hosts:
    content: native_messaging_hosts
    target: $SNAP_USER_COMMON/.mozilla/native-messaging-hosts

This is not perfect. It means that there can only be one addon that uses Native Messaging at a time. Also according to https://developer.chrome.com/extensions/nativeMessaging path does not support relative paths. That makes it hard to set the correct path for the executable. But I think having this plug is better than having no way to use another snap for Native Messaging.

The problem is similar to bug #1741074 in the chromium snap.

I haven’t tested with the firefox snap yet, but I have managed to make a simple native host connector run with the chromium snap (see bug report), so I will try to replicate this with firefox.

Hi, have you been able to get this working with firefox? I have tried something along the lines of your chromium suggestion (but adapted for firefox, of course), but couldn’t get it to work. As snap is now becoming the default way to install software on ubuntu, I find it really distressing that there currently seems to be no way to make this work…

Thanks a lot!