balta2ar / brotab

Control your browser's tabs from the command line
MIT License
389 stars 27 forks source link

Support chrome/chromium installed via snap (Ubuntu 20) #33

Open balta2ar opened 4 years ago

balta2ar commented 4 years ago

Mediator app wouldn't start when installed into a Chrome/Chromium via snap.

There are several issues with how Chromium is run via snap:

  1. Chromium can't see locally-install pip packages, it doesn't have access to ~/.local. Solution: sudo pip3 install brotab
  2. Native app config is in a different place, e.g.: ~/snap/chromium/1165/.config/chromium/NativeMessagingHosts/brotab_mediator.json. Solution: support that location in bt install (TODO).
  3. Wrong path to binary. It should be something like /usr/local/bin/bt_mediator
  4. The mediator still wouldn't start with the message: "Native app cannot be found" or along those lines.

I couldn't figure out all the issues with the snap-installed chromium and I'll probably will not do that since I removed it and installed from apt repo: sudo add-apt-repository ppa:saiarcot895/chromium-dev. Anyone's willing to dig into it, welcome.

blurayne commented 4 years ago

It's snap confinement. See https://bugs.launchpad.net/ubuntu/+source/chromium-browser/+bug/1741074

I'm also fiddling around to find a workaround. Main problem is that Native Messaging Hosts do have dependencies you don't just want to put into the snap. So I don't see a probable solution around there.

xeor commented 4 years ago

This is also a problem if you are using firefox installed using snap

jirislav commented 2 years ago

Can confirm the problem is also with Firefox. Which is a bigger problem now, since firefox is shipped as snap by default in Ubuntu LTS 22.04.

h43z commented 6 months ago

brotab still works you just have to give it permission.

Here how it's done for firefox

flatpak permission-set webextensions brotab_mediator snap.firefox yes