Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Companion app cannot be found when using Flatpak builds of Firefox #137

Closed
nunyafukkinbizness opened this issue Sep 1, 2022 · 16 comments
Closed

Comments

@nunyafukkinbizness
Copy link

The video downloadhelper Companion app cannot be found when using Flatpak or Snap builds of Firefox
Why was this issue closed when it hasn't been solved? This issue has existed for at least a year! Work on it! I have found another add on that works without any companion app for most sites and yet another one that works in youtube without a companion app! I love video downloadhelper and used it for many years but if it isn't fixed to work with Ubuntu 22.04 104.0.1 (64-bit) Snap and Flatpak versions it is useless for Ubuntu, and I'm sure other Linux users. Linux is growing don't lose your audience by ignoring them!

@RylanSchaeffer
Copy link

@nunyafukkinbizness do you have a solution? I have this same issue!

@posita
Copy link

posita commented Sep 15, 2022

Ref #91. Also, from https://bugzilla.mozilla.org/show_bug.cgi?id=1621763#c5 regarding possible solutions:

The portal discovery idea and the socket communication suggestions seem promising for providing a more secure way of supporting native messaging from the Firefox flatpak. Another method I was wondering about was using Flatpak Extensions. I am not that familiar with how they work exactly but I think they act as a kind of overlay onto the flatpak the way that the app flatpak overlays the runtime flatpak. My thought was that perhaps the native messaging host application could be packaged into an extension and optionally installed on top of the Firefox flatpak. I think this might work well for something like the KDE Plasma/Browser integration because the native messaging app is just a small program that needs a dbus permission to talk to for its functionality. Perhaps other native messaging hosts do not fit this model.

One other thing I thought was interesting was that the Zotero WebExtension worked fine with both Zotero and Firefox as flatpaks. The reason for this is that the Zotero application runs an http server and the Zotero WebExtension communicates with that server via http. Since both flatpaks have the network permission, the WebExtension was able to communicate with the application just as it normally does.

See also:

@SifiW
Copy link

SifiW commented Sep 18, 2022

You can uninstall Firefox and install from PPA following these instructions and the companion app will be found again. #133 (comment)

@knghtbrd
Copy link

StreamDeck doesn't use PPAs, but does use Flatpack Firefox. The solution is likely to use the program Flatseal to configure Firefox's sandbox to open access fore VDH to "see" coapp. If I understood what exactly what isn't happening, I could probably work out what needs to be done to fix it.

@justunsix
Copy link

justunsix commented Oct 22, 2022

Here is a workaround to get the Video Downloadhelper Companion App visible in the Flatpak Firefox so the add on can use it to download files. Workaround is based on ideas listed in the sources section. It involves:

  • Copying the browser native messaging hosts configuration to the Flatpak Firefox configuration directory
  • Granting Flatpak Firefox read access to the Companion app's binaries so the add on can see it.

Workaround Steps

  • Install the Companion application using Linux - 64 bits - targz option and follow extra install instructions on the site. Extract it to a folder you choose. Copy the folder location, you will need it later.
  • Copy the net.downloadhelper.coapp.json in a non-Flatpak Firefox's configuration folder generated during the Companion application install to the Flatpak Firefox's configuration folder.
    • For example: cp ~/.mozilla/native-messaging-hosts/net.downloadhelper.coapp.json ~/.var/app/org.mozilla.firefox/.mozilla/native-messaging-hosts/
      • ~/.var/app/org.mozilla.firefox/.mozilla is the Flatpak Firefox's folder. Create the native-messaging-hosts folder if it doesn't exist already in that folder.
      • ~/.mozilla/ is a non-Flatpak Firefox installation folder and will vary depending on your installation. In my case, I have the Ubuntu Snap version of Firefox installed before installing the Flatpak version.
  • Give the Flatpak Firefox read only access to the Companion application and its binaries.
    • For example, using Flatseal, add the location from the first step into Firefox's permissions under > Filesystem > Other Files > Add Folder <your-folder-name-from-first-step-net.downloadhelper.coapp>/:ro
      • ro means read only
  • Restart the Flatpak Firefox
  • Check the Companion App is recognized in Firefox. Try downloading a video.

The workaround is granting extra permissions to the Flatpak Firefox so use with care.

Sources

Thank you to these posts for contributing to the steps above.

  1. Companion app cannot be found when using Flatpak builds of Firefox #91 (comment) - insecure work around
  2. Companion app cannot be found when using Flatpak builds of Firefox #137 (comment) - idea to give Firefox permissions to see the Companion application
  3. How to install Video DownloadHelper coapp in flatpak Chrome...

Problems

Problems I encountered and fixes.

The companion app keeps saying "Verifying..."

  • It turned out I put the net.downloadhelper.coapp.json in the wrong folder. Check the file is in the correct Flatpak Firefox configuration folder.

Downloads failing with read only filesystem error.

  • I had to grant read and write access to the download folder to Firefox. There may be a more secure way of doing this.
    • For example, using Flatseal, add the download location to Firefox's permissions under > Filesystem > Other Files > Add Folder ~/Downloads:rw
      • rw means read and write

@CHJ85
Copy link

CHJ85 commented Dec 17, 2022

This is still an issue.
Will there be a flatpak available soon?
I'd really like to use this addon.
I looked at the workaround, but that sounds way over my head.

@jntesteves
Copy link

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.

@CHJ85
Copy link

CHJ85 commented May 12, 2023

Thank you so much @jntesteves

@cheako
Copy link

cheako commented Jun 28, 2023

Here is another solution: #91 (comment)

@jntesteves
Copy link

Here is another solution: #91 (comment)

That is not a solution, it is an insecure hack and totally unnecessary. Don't do that!

The solution to this issue is to just update the installation instructions to install it correctly within the sandbox, like I mentioned in the comment above. I'd send a PR if the documentation repository was public, but it doesn't seem like it is. Is the maintainer still active? @mi-g

@paulrouget
Copy link
Member

@jntesteves i'm looking into that. I will add the proper instructions, and maybe add that to an install script.

@paulrouget
Copy link
Member

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

@paulrouget
Copy link
Member

Closing in favor of #159

@CHJ85
Copy link

CHJ85 commented Sep 6, 2023

I'm no longer using the Flatpak version anymore due to all kinds of problems.
However. vdhcoapp is not recognized by latest Firefox build 117.0, on Manjaro Linux.
This is not related to the Flatpak issue though.

@paulrouget
Copy link
Member

I'm no longer using the Flatpak version anymore due to all kinds of problems. However. vdhcoapp is not recognized by latest Firefox build 117.0, on Manjaro Linux. This is not related to the Flatpak issue though.

Can you file a specific issue for that? I can assist in debugging.

@CHJ85
Copy link

CHJ85 commented Sep 6, 2023

@paulrouget Sure, and thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants