ff2mpv icon indicating copy to clipboard operation
ff2mpv copied to clipboard

Support for snap/flatpak distributions of Firefox

Open allanlaal opened this issue 2 years ago • 20 comments

ff2mpv seems to no longer work in Firefox 99

starting from 99 firefox moved to snap, but their migration tool did not copy the native-messaging-hosts/ff2mpv.json (and others?) file. the profile root that used to be ~/.mozilla is now in ~/snap/firefox/common/.mozilla/

allanlaal avatar Apr 07 '22 21:04 allanlaal

copying ff2mpv.json to ~/snap/firefox/common/.mozilla/native-messaging-hosts/ff2mpv.json did not help

allanlaal avatar Apr 08 '22 00:04 allanlaal

Could you please fill out the entire bug report template? It provides the context I need to help debug this.

For context: I'm running Firefox 99 on Ubuntu LTS (20.04) using the recommended installation, and ff2mpv works correctly for me. snap is still not the recommended way to install Firefox on Linux distributions, because its isolation/sandboxing mechanism causes problems like these.

woodruffw avatar Apr 08 '22 02:04 woodruffw

Could you please fill out the entire bug report template? It provides the context I need to help debug this.

i'll get to it ASAP

allanlaal avatar Apr 08 '22 17:04 allanlaal

snap is still not the recommended way to install Firefox on Linux distributions,

I'm on Ubuntu 22.04, so I am a voice from the future =)

https://news.itsfoss.com/ubuntu-firefox-snap-default/ deb vs snap

allanlaal avatar Apr 08 '22 17:04 allanlaal

@woodruffw is ff2mpv impossible with snap?

Firefox-ESR is still a proper deb package on 22.04, but its only a matter of time till ff2mpv becomes totally useless in Ubuntu ≥20.10 :(

allanlaal avatar Apr 08 '22 17:04 allanlaal

is ff2mpv impossible with snap?

I don't know if it's impossible, but it's probably more difficult given snap's pseudo-isolation.

I ran into a similar problem while trying to test ff2mpv on Chrome/Chromiuim via snap -- the default native messaging directories weren't respected, and neither were the "isolated" ones.

Looks like this isn't a new problem:

  • https://forum.snapcraft.io/t/firefox-support-native-messaging/11068
  • https://bugzilla.mozilla.org/show_bug.cgi?id=1661935

woodruffw avatar Apr 10 '22 00:04 woodruffw

I'm going to follow up on that BMO bug report, since it looks like Mozilla's devs are already aware this this is going to be a problem.

Edit: Ref: https://bugzilla.mozilla.org/show_bug.cgi?id=1661935

woodruffw avatar Apr 10 '22 00:04 woodruffw

FWIW, I tested this extension and the native host connector with https://phabricator.services.mozilla.com/D140803 built in the firefox snap, and I'm happy to report that it works as expected. This is still work in progress, but it is getting closer to a releasable state.

oSoMoN avatar Apr 11 '22 07:04 oSoMoN

FWIW, I tested this extension and the native host connector with https://phabricator.services.mozilla.com/D140803 built in the firefox snap, and I'm happy to report that it works as expected. This is still work in progress, but it is getting closer to a releasable state.

That's great news! Thanks for testing that.

It sounds like we might want to add some additional documentation to the wiki when the new LTS fully rolls out, but otherwise that there are no major changes needed to ff2mpv itself. Am I understanding that correctly?

woodruffw avatar Apr 11 '22 13:04 woodruffw

That's correct, no functional changes should be required, other than a documentation update.

oSoMoN avatar Apr 11 '22 14:04 oSoMoN

Excellent. We'll leave this open for now, just so other users who experience breakage during the packaging change have a place to look.

woodruffw avatar Apr 11 '22 15:04 woodruffw

Pinging back on this: can any users confirm that this extension is working correctly for them with the snap-ified distribution of Firefox in 22.04?

woodruffw avatar May 18 '22 23:05 woodruffw

tested with Firefox 100 from snap: does not work

works fine with straight .deb distributions though. firefox-next ppa doesn't use snap :+1:

allanlaal avatar May 23 '22 14:05 allanlaal

same here for flatpak...it doesn't works

FallCheetah7373 avatar May 28 '22 14:05 FallCheetah7373

Another pingback: I'll probably upgrade my own machine when 22.04.1 is released, which will likely be in the next couple of weeks. If it's still broken when that happens, I'll try and fix it...

woodruffw avatar Aug 02 '22 04:08 woodruffw

This doesn't work in Ubuntu 22.04 out of the box just yet, but is being addressed. Please see the corresponding call for testing. I personally tested ff2mpv and got it working, if you're seeing something different please comment on that thread. Thanks!

oSoMoN avatar Aug 02 '22 14:08 oSoMoN

I upgraded today, and this is the only command I needed to run to get things working:

flatpak permission-set webextensions ff2mpv snap.firefox yes

(I did need to install flatpak via sudo apt install -y flatpak).

Could someone else in this thread confirm that the above makes the extension work for them? If so, I'm inclined to close this as fixed upstream (albeit in an annoying manner).

woodruffw avatar Sep 13 '22 02:09 woodruffw

Forgot to mention: I did have to switch to the "beta" channel:

sudo snap refresh firefox --beta

woodruffw avatar Sep 13 '22 02:09 woodruffw

A couple of comments on this:

  • In theory one should be prompted for permission by their desktop environment (GNOME Shell displays a modal prompt) the first time firefox requests access to a given native application through the portal. Choosing yes means no further action needed, but it could be that other desktop shells haven't implemented that prompt yet, and so the permission defaults to "no".
  • The use of the flatpak command is quite confusing indeed. This is because the permissions database, even though it’s not flatpak-specific (it’s also used for snaps), doesn’t have its own separate management tool yet.
  • As you mentioned, this is not available in a stable version of firefox yet, you'll need to use the snap from the beta or edge channel for now. I'm hoping this will land very soon in stable, but until that happens it's probably premature to mark it fixed.

oSoMoN avatar Sep 13 '22 16:09 oSoMoN

Thanks for these comments!

The point about the permission prompt makes sense: I'm using i3wm, which probably doesn't have support for this kind of stuff. It's good to know that the experience should be smoother for most other users.

woodruffw avatar Sep 13 '22 16:09 woodruffw

This has been working for me with the snap-ified Firefox on Ubuntu 22.04 for the last two weeks, so I'm closing it.

woodruffw avatar Sep 24 '22 20:09 woodruffw

I upgraded today, and this is the only command I needed to run to get things working:

flatpak permission-set webextensions ff2mpv snap.firefox yes

(I did need to install flatpak via sudo apt install -y flatpak).

Could someone else in this thread confirm that the above makes the extension work for them? If so, I'm inclined to close this as fixed upstream (albeit in an annoying manner).

This doesn't work for firefox 112 with flatpak...

  • copied ff2mpv.json to ~/.var/app/org.mozilla.firefox/.mozilla/native-messaging-hosts
  • changed the path of ff2mpv.py
  • gave a permission: flatpak permission-set webextensions ff2mpv org.mozilla.firefox yes

Maybe it is just solved for only snap` firefox atm

EDIT: made it work according to these instructions

ugurbolat avatar Apr 15 '23 14:04 ugurbolat