aclap-dev / vdhcoapp

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

"Checking companion app returned: Method info is not a function" #134

Closed wklaebe closed 1 year ago

wklaebe commented 2 years ago

In firefox (newest available, 101.0.1), Video DownloadHelper 7.6.0 claims "Companion App not installed", "Checking companion app returned: Method info is not a function". Using strace, I can see ~/net.downloadhelper.coapp-1.6.3/bin/net.downloadhelper.coapp-linux-64 $HOME/.mozilla/native-messaging-hosts/net.downloadhelper.coapp.json '{b9db16a4-6edc-47ec-a1f4-b86292ed211d}' being execve'd. It then gets handed two commands on fd 0 and replies with error messages:

read(0, "<\0\0\0{\"type\":\"weh#rpc\",\"_request\":44,\"_method\":\"quit\",\"_args\":[]}", 65536) = 64
write(1, "G\0\0\0", 4)                  = 4
write(1, "{\"type\":\"weh#rpc\",\"_reply\":44,\"_error\":\"Method quit is not a function\"}", 71) = 71
epoll_wait(30, [{EPOLLIN, {u32=0, u64=0}}], 1024, 8095) = 1
read(0, "<\0\0\0", 65536)               = 4
epoll_wait(30, [{EPOLLIN, {u32=0, u64=0}}], 1024, 5344) = 1
read(0, "{\"type\":\"weh#rpc\",\"_request\":45,\"_method\":\"info\",\"_args\":[]}", 65536) = 60
write(1, "G\0\0\0", 4)                  = 4
write(1, "{\"type\":\"weh#rpc\",\"_reply\":45,\"_error\":\"Method info is not a function\"}", 71) = 71

This seems to keep me from downloading videos...

webenhanced commented 2 years ago

I have the same versions of Firefox, VDH, and Coapp, on Fedora 35 Linux. It is working 100% for me.

What distro are you on?

And when was firefox updated? Perhaps it is a distro thing.

wklaebe commented 2 years ago

I'm on Devuan, somewhere between testing and unstable. Firefox is not from Devuan, but https://download.mozilla.org/?product=firefox-latest-ssl&os=linux64&lang=en-US (which currently still redirects to https://download-installer.cdn.mozilla.net/pub/firefox/releases/101.0.1/linux-x86_64/en-US/firefox-101.0.1.tar.bz2), which I then unpack to /opt/firefox as root for security reasons. I think that should ideally work everywhere.

wklaebe commented 2 years ago

Oh, another thing:

$ printf "<\0\0\0{\"type\":\"weh#rpc\",\"_request\":44,\"_method\":\"info\",\"_args\":[]}" | ~/net.downloadhelper.coapp-1.6.3/bin/net.downloadhelper.coapp-linux-64 ~/.mozilla/native-messaging-hosts/net.downloadhelper.coapp.json "{b9db16a4-6edc-47ec-a1f4-b86292ed211d}"
G{"type":"weh#rpc","_reply":44,"_error":"Method info is not a function"}
$

Doesn't even need Firefox for that.

wklaebe commented 2 years ago

I strace-d that further and noted it reading ~/.npmrc (which contained exactly the line cafile = /usr/share/ca-certificates/mozilla/). Afterwards, it tried to open() and read() that directory, which failed with -EISDIRECTORY.

After I removed ~/.npmrc, the download helper works.

Would be nice if it would output some better error message in the future...

paulrouget commented 1 year ago

Superseded by https://github.com/aclap-dev/vdhcoapp/issues/170