aclap-dev / vdhcoapp

Companion application for Video DownloadHelper browser add-on
GNU General Public License v2.0
1.72k stars 280 forks source link

Flatpak firefox doesn't recognize vdhcoapp #114

Closed oshanz closed 1 year ago

oshanz commented 2 years ago

I use flatpak firefox(https://flathub.org/apps/details/org.mozilla.firefox). Installed the firefox addon and targz vdhcoapp on the user level. however, on download action addon seems not to recognize the vdhcoapp installation. it's throwing "This operation requires an external application to be completed."

image

image

I've tried several combinations of settings to provide through flatseal(https://flathub.org/apps/details/com.github.tchx84.Flatseal). neither worked.

image

firefox version: 95 os: opensuse tumbleweed

Jeoshua commented 2 years ago

Same issue, this really needs to be fixed. Ubuntu has stopped releasing Firefox as anything other than a Snap. Using the .deb version is no longer an option, and if we don't wanna be saddled with Snap, Flatpak is the only option.

knghtbrd commented 2 years ago

As noted in #96 this is becoming a larger issue. Notably, Firefox on SteamDeck will also be Flatpak-only.

leleleSDX commented 2 years ago

We can't even make this program work in firejail. Running firefox outside of a sandbox makes god cry.

Kurisu3 commented 2 years ago

So wouldn't it be possible to make it so that we can manually change the path to the CoApp in the browser extension settings and give it necessary permissions if needed ?

mi-g commented 2 years ago

Unfortunately, this is more complex. First, the coapp is located on an other filesystem than the browser (+extension) installed with snap/flatpack. Next, for security reasons, extensions have strictly no access to the native apps path. The browser API is in between and it requires declaring the coapp to the browser through manifest files. You can get more technical details by searching for "nativemessaging api".

mi-g commented 2 years ago

Mozilla is aware of this issue and the bug has been assigned: https://bugzilla.mozilla.org/show_bug.cgi?id=1661935

For now, the only workaround is to install Firefox not using snap/flatpak. For Ubuntu 22.04, you can install Firefox manually from https://ftp.mozilla.org/pub/firefox/releases/

Kurisu3 commented 2 years ago

@mi-g Thanks for your reply. I created a desktop shortcut on Ubuntu 22.04 that runs /snap/firefox/current/usr/lib/firefox/firefox and now it works fine as well as other extensions that have the same issue like uget-integrator .

I suspect this may not be recommended and will require reinstalling extensions after each snap firefox update.

mi-g commented 2 years ago

Indeed, executing the snap-installed version from the top level filesystem path does the trick, thanks for sharing ! It is important to understand that doing this removes the snap sandboxing security feature (same as if you install Firefox manually). Also, the browser user profile is different when you run Firefox from snap or top-level.

pizzadude commented 2 years ago
  1. Extract the vdhcoapp somewhere in your home directory, let's say /home/user/net.downloadhelper.coapp
  2. Make the directory ~/.var/app/org.mozilla.firefox/.mozilla/native-messaging-hosts if it doesn't already exist
  3. Copy net.downloadhelper.coapp.json into the directory. The file should look like this: (Make sure the path is correct)
    {
    "name": "net.downloadhelper.coapp",
    "description": "Video DownloadHelper companion app",
    "path": "/home/user/net.downloadhelper.coapp/bin/net.downloadhelper.coapp-linux-64",
    "type": "stdio",
    "allowed_extensions": [
        "weh-native-test@downloadhelper.net",
        "{b9db16a4-6edc-47ec-a1f4-b86292ed211d}"
    ]
    }
  4. Whitelist vdhcoapp dir " ~/net.downloadhelper.coapp " using Flatseal or flatpak override
  5. ???
  6. Profit! image
SifiW commented 2 years ago

You can remove the snap Firefox and reinstall through PPA and the companion app will be found. https://github.com/mi-g/vdhcoapp/issues/133#issuecomment-1165334764

jntesteves commented 1 year ago

Installing for Firefox Flatpak is super easy, it just needs a small adaptation to the installation instructions:

tar xf net.downloadhelper.coapp-1.6.3-1_amd64.tar.gz -C ~/.var/app/org.mozilla.firefox
flatpak run --command=$HOME/.var/app/org.mozilla.firefox/net.downloadhelper.coapp-1.6.3/bin/net.downloadhelper.coapp-linux-64 org.mozilla.firefox install --user

I'd also recommend changing the default download folder in the extension's settings to ~/Downloads. No messing with permissions necessary.

paulrouget commented 1 year ago

Is this still a problem with the latest version of Firefox? It's supposed to have been fixed.

paulrouget commented 1 year ago

Closing in favor of https://github.com/aclap-dev/vdhcoapp/issues/159