vdhcoapp icon indicating copy to clipboard operation
vdhcoapp copied to clipboard

Doesn't work with Waterfox on Linux even though app already installed

Open audio101 opened this issue 1 year ago • 27 comments

companion application required

Companion App not installed

vdhcoapp-bin 2 0 7-1

manual install

vdhcoapp-bin 2.0.7-1 [AUR]

waterfox-bin G6.0.6-1 [AUR]

[Linux, Manjaro XFCE]

audio101 avatar Nov 28 '23 09:11 audio101

What's the profile directory for Waterfox ?

paulrouget avatar Nov 28 '23 10:11 paulrouget

/home/user/.waterfox/user.Default User/

audio101 avatar Nov 28 '23 11:11 audio101

If you copy ~/.mozilla/native-messenging-host into ~/.waterfox, does it work?

paulrouget avatar Nov 28 '23 12:11 paulrouget

Screenshot from 2023-11-28 23-17-52

audio101 avatar Nov 28 '23 12:11 audio101

When installed manually from home directory, it works (but must leave files there or else it doesn't work):

Companion App installed

When installed from AUR or from Opt directory, it doesn't work:

Companion App not installed

Also note I have a non-default profile folder set in my home directory for the browser.

Hope this helps.

audio101 avatar Nov 28 '23 18:11 audio101

Do not use the Aur package, use the package we provide: https://github.com/aclap-dev/vdhcoapp/releases

Install the tar.bz2 (untar it anywhere you want) and the run <PATH>/vdhcoapp install.

Then ln -s ~/.mozilla/native-messenging-host your_profile_dir.

This is necessary for waterfox to know the existence of the coapp.

paulrouget avatar Nov 29 '23 04:11 paulrouget

Abrowser works automatically after manual install:

abrowser

Waterfox still not working:

waterfox link

waterfox

audio101 avatar Nov 29 '23 05:11 audio101

Also note I have a non-default profile folder set in my home directory for the browser.

How do you set the profile directory?

paulrouget avatar Nov 29 '23 06:11 paulrouget

Using the "waterfox -p" command

audio101 avatar Nov 29 '23 06:11 audio101

And is it recognized if you do not use a custom profile?

If not, is it recognized if you create a directory like this:

~/.waterfox/native-messenging-host

which recreate the .mozilla directory structure?

I'm trying to understand if it's a bug of Waterfox or a bug of our Coapp.

paulrouget avatar Nov 29 '23 07:11 paulrouget

I tested using a default Waterfox profile (i.e. /home/user/.waterfox/8v5oj8e6.Default User/) and it still does not detect the app which is already installed, same error as custom profile:

"Checking companion app returned: An unexpected error occurred".

/home/user/.waterfox/native-messaging-hosts/ already exists containing the file:

"net.downloadhelper.coapp.json"

audio101 avatar Nov 29 '23 10:11 audio101

I'll look up waterfox internals.

Creating /home/user/.waterfox/native-messaging-hosts/net.downloadhelper.coapp.json with the same content as /home/user/.mozilla/native-messaging-hosts/net.downloadhelper.coapp.json should have worked.

Do you use a flatpak or snap version of Waterfox?

paulrouget avatar Nov 29 '23 10:11 paulrouget

Using AUR version: waterfox-bin G6.0.6-1

audio101 avatar Nov 29 '23 10:11 audio101

There's a path to the binary within /home/user/.mozilla/native-messaging-hosts/net.downloadhelper.coapp.json

What's the path, and when you run that binary with --info, what does it say?

paulrouget avatar Nov 29 '23 18:11 paulrouget

There is only 1 file within the folder:

/home/user/.mozilla/native-messaging-hosts/net.downloadhelper.coapp.json

There is no other files or binary in that folder.

The only binaries are in the install folder:

"/opt/vdhcoapp-2.0.8/"

vdhcoapp, ffmpeg, ffprobe

Any chance you can run/test it on your end, and/or in a virtual environment Manjaro XFCE?

audio101 avatar Nov 29 '23 19:11 audio101

Look inside /home/user/.mozilla/native-messaging-hosts/net.downloadhelper.coapp.json

grep path ~/.mozilla/native-messaging-hosts/net.downloadhelper.coapp.json

This will give you the path of the binary (for example "/opt/foo/vdhcoapp").

Then run that binary with the option --info: /opt/foo/vdhcoapp --info.

paulrouget avatar Nov 30 '23 07:11 paulrouget

[linux@user vdhcoapp-2.0.8]$ ./vdhcoapp --info { "id": "net.downloadhelper.coapp", "name": "VdhCoApp", "version": "2.0.8", "binary": "/opt/vdhcoapp-2.0.8/vdhcoapp", "displayName": "VdhCoApp", "description": "Video DownloadHelper companion app", "target": { "os": "linux", "arch": "x86_64", "node": "18" }, "home": "/home/user", "converterBinary": "/opt/vdhcoapp-2.0.8/ffmpeg", "converterBase": "ffmpeg", "converterBaseVersion": "6.0" }

audio101 avatar Nov 30 '23 07:11 audio101

This is maybe not the correct place because it's not about Waterfox, but it's a similar issue, and the solution might help others.

I'm on Fedora 39 with Firefox (RPM, not snap or whatever), running with multiple profiles. When I updated to 2.0.10 and clicked the "Recheck" button, at first I had issues finding the Companion App. It returned: An unexpected error occurred.

What I figured out, is that when doing a system-install (/opt/vdhcoapp-2.0.10/vdhcoapp install), the installer places this JSON file: /usr/lib/mozilla/native-messaging-hosts/net.downloadhelper.coapp.json and Firefox does not appear to find this file.

After I symlinked net.downloadhelper.coapp.json into ~/.mozilla/native-messaging-hosts and clicked the "Recheck" button, the Companion App was found: /opt/vdhcoapp-2.0.10/vdhcoapp.

So, to round it up, this worked for me, with multiple Firefox profiles: ln -s /usr/lib/mozilla/native-messaging-hosts/net.downloadhelper.coapp.json ~/.mozilla/native-messaging-hosts (Run as user, not as root) Perhaps this helps to do something similar for Waterfox

storm49152 avatar Dec 22 '23 12:12 storm49152

@storm49152 Hm, I'm surprised you had to do that.

Did you run the install command as root (you should not)?

paulrouget avatar Dec 22 '23 13:12 paulrouget

$ ln -s /usr/lib/mozilla/native-messaging-hosts/net.downloadhelper.coapp.json ~/.mozilla/native-messaging-hosts ln: failed to create symbolic link '/home/linux/.mozilla/native-messaging-hosts/net.downloadhelper.coapp.json': File exists

audio101 avatar Dec 23 '23 05:12 audio101

If you arrive here because of Google, please look at the troubleshooting section: https://github.com/aclap-dev/vdhcoapp/blob/master/README.md#troubleshooting

paulrouget avatar Dec 23 '23 09:12 paulrouget

Just had an idea (since I've had so many issues getting it to work mainly with Mozilla-based browsers, and so far it's still not working on the latest Waterfox vG6.0.7: "Checking companion app returned: An unexpected error occurred".

I was thinking (if it's possible and to code) in the settings under General > "Companion App", when it states "Companion App not installed", why not add a clickable button there that loads the system file manager which allows the user to manually "point" to the installed Companion app binary file path in their directory, and/or any other necessary files for it to work. That way it can then detect the Companion App files that have already been installed on the system, especially for the many varied Linux distros and other obscure/less common browsers, and also not having to create manual symlinks to get it to work.

So the end result would then hopefully be:

Found companion app: VdhCoApp 2.0.10 Companion app binary: /opt/vdhcoapp-2.0.10/vdhcoapp

What are your thoughts on this?

audio101 avatar Dec 23 '23 10:12 audio101

Sadly this is not how browser extension work. The extension doesn't know and can't know where the coapp is located.

since I've had so many issues getting it to work mainly with Mozilla-based browsers

I have no idea what's going on with these special version of Firefox, but I believe the bug is on their side, not on the coapp side. They should be looking for the manifest in the mozilla directory, but they're not.

paulrouget avatar Dec 23 '23 17:12 paulrouget

Ok, thanks for the update & trying to resolve this issue...

If there's any other future updates or a fix for this, please post here. Cheers.

audio101 avatar Dec 24 '23 01:12 audio101

@paulrouget That would be my mistake then: I checked the Bash history, and I installed as root.

storm49152 avatar Dec 27 '23 10:12 storm49152

Sorry to revive this. But considering I have essentially the same kind of problem, it felt more appropriate than to start a new issue. I am on Fedora and use the flatpak version of librewolf. I installed the coapp with curl -sSLf https://github.com/aclap-dev/vdhcoapp/releases/latest/download/install.sh | bash after that I ran ~/.local/share/vdhcoapp/vdhcoapp install and flatpak permission-set webextensions net.downloadhelper.coapp io.gitlab.librewolf-community yes, but librewolf is still unable to find the coapp. the output of .local/share/vdhcoapp/vdhcoapp --info is

{
  "id": "net.downloadhelper.coapp",
  "name": "VdhCoApp",
  "version": "2.0.19",
  "binary": "/home/kromilan/.local/share/vdhcoapp/vdhcoapp",
  "displayName": "VdhCoApp",
  "description": "Video DownloadHelper companion app",
  "target": {
    "os": "linux",
    "arch": "x86_64",
    "node": "18"
  },
  "home": "/home/kromilan",
  "converterBinary": "/home/kromilan/.local/share/vdhcoapp/ffmpeg",
  "converterBase": "ffmpeg",
  "converterBaseVersion": "c30f360"
}

Kromilan avatar Jun 26 '24 09:06 Kromilan