andy-portmen / native-client

Native Messaging component for Windows, Linux, and Mac OS that is written in NodeJS.
https://add0n.com/open-in.html
Mozilla Public License 2.0
712 stars 472 forks source link

Can't seem to install #108

Open dennisTGC opened 2 years ago

dennisTGC commented 2 years ago

Firefox connection check fails after installation.

I'm running Ubuntu 22.04 (so still experimental for a month) and Firefox 98.

I'll try update this issue after 22.04 becomes LTS.

andy-portmen commented 2 years ago

Is there any error on the installer.sh's output?

dennisTGC commented 2 years ago

No, not that I can see:

NodeJS status = 1
Installer is using the embedded NodeJS

 -> Root directory is /home/user/.config
 -> Creating a directory at /home/user/.config/google-chrome/NativeMessagingHosts
 -> Chrome Browser is supported
 -> Creating a directory at /home/user/.config/chromium/NativeMessagingHosts
 -> Chromium Browser is supported
 -> Creating a directory at /home/user/.config/vivaldi/NativeMessagingHosts
 -> Vivaldi Browser is supported
 -> Creating a directory at /home/user/.config/BraveSoftware/Brave-Browser/NativeMessagingHosts
 -> Brave Browser is supported
 -> Creating a directory at /home/user/.config/microsoftedge/NativeMessagingHosts
 -> Microsoft Edge Browser is supported
 -> Creating a directory at /home/user/.mozilla/native-messaging-hosts
 -> Firefox Browser is supported
 -> Creating a directory at /home/user/.waterfox/native-messaging-hosts
 -> Waterfox Browser is supported
 -> Creating a directory at /home/user/.tor-browser/app/Browser/TorBrowser/Data/Browser/.mozilla/native-messaging-hosts
 -> Tor Browser is supported
 -> Creating a directory at /home/user/.thunderbird/native-messaging-hosts
 -> Thunderbird Email Client is supported
 -> Creating a directory at /home/user/.config/com.add0n.node
 => Native Host is installed in /home/user/.config/com.add0n.node

>>> host is ready <<<
andy-portmen commented 2 years ago

It looks fine! Let's see if we can find something in the browser's console log.

Use Ctrl + J to open the browser console. Now try to use the extension and see if it generates a new error in the log section of the console.

Gitoffthelawn commented 2 years ago

Small correction... use Ctrl + Shift + J to open the browser console.

dennisTGC commented 2 years ago

sorry it took a while, github had issues too..

Unchecked lastError value: Error: Could not establish connection. Receiving end does not exist. 2 background.js:1
Unchecked lastError value: Error: Could not establish connection. Receiving end does not exist. 2 background.js:1
ExtensionError: No such native application com.add0n.node ExtensionUtils.jsm:58:5
Unchecked lastError value: Error: Attempt to postMessage on disconnected port common.js:51
Unchecked lastError value: Error: Could not establish connection. Receiving end does not exist. 4 background.js:1
ExtensionError: No such native application com.add0n.node ExtensionUtils.jsm:58:5
Unchecked lastError value: Error: Attempt to postMessage on disconnected port index.js:93
sean1138 commented 2 years ago

xubuntu 20.04 same image

sverris commented 2 years ago

Same here (Lubuntu, 22.04). Does not work for VLC and MPV anymore since yesterday. I switched to 22.04 beta yesterday. Wild guess: Firefox switched to snap, and I get the feeling that breaks something...

andy-portmen commented 2 years ago

as far as I know, a Snapped app is sandboxed to a single directory inside "~/snap/" directory. To have a valid native client, we need to copy the executable to this directory. Even though this fixes the communication issue, still not a useful approach. There is no way to access the external browser (it is located outside of the root directory).

I am attaching a working native client (x64 only) for testing purposes. Use Firefox with Ctrl + Shift + J to see the error logs.

linux.zip

sverris commented 2 years ago

Thanks. The new client does not help with MPV, but for VLC it does create a working connection. Yet the path for the VLC binary ( /snap/bin/vlc ?) is not correct - and whatever I try, it does not work.

dennisTGC commented 2 years ago

The connection works, but it can't find the executable, not even when filling in the correct path. Happens with brave and chromium-browser.

Unchecked lastError value: Error: Could not establish connection. Receiving end does not exist. 4 background.js:1
    send moz-extension://5627815e-f99e-4a0d-86a9-bb84f55f5d09/background.js:1
SigmFreud commented 2 years ago

...a Snapped app is sandboxed to a single directory inside "~/snap/" directory. To have a valid native client, we need to copy the executable to this directory. ...I am attaching a working native client linux.zip

A directory was needed: -> Creating a directory at /home/user/snap/firefox/common/com.add0n.node => Native Host is installed in /home/user/snap/firefox/common/com.add0n.node ... -> Creating a directory at /home/user/snap/firefox/common/.mozilla/native-messaging-hosts -> Firefox Browser (snap version) is supported And ffmpeg installed to: /home/user/snap/firefox/common/ffmpeg

Now it works! Thanks very much!

staerz commented 2 years ago

Hi @andy-portmen,

thanks for your effort in providing this addon in the first place. I was about to type together my own little local extension but then ran into the problem of javascript opening an external application from firefox ...

Unfortunately I am one of those

Distributor ID: Ubuntu
Description:    Ubuntu 22.04 LTS
Release:    22.04
Codename:   jammy

users who run into the problem that @sean1138 is describing.

I have also tried your provided hotfix but unfortunately that didn't help.

Note that I've installed nodejs prior to running the install.sh:

/usr/bin/node
NodeJS status = 0
Installer is using your system NodeJS.
...

but I still get the connection problem.

Any help in sight?

jgsimard commented 1 year ago

@andy-portmen @staerz any updates on this? I am on ubuntu 22.04 LTS. I got VLC and firefox from snap and it is not working

staerz commented 1 year ago

@andy-portmen @staerz any updates on this? I am on ubuntu 22.04 LTS. I got VLC and firefox from snap and it is not working

Nope.