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
727 stars 474 forks source link

Fix #118: Cannot find module '${HOME}/host.js' #119

Closed justfortherec closed 4 months ago

justfortherec commented 1 year ago

It appears that Firefox starts the native client from $HOME as the working directory. That leads to the script resolving the relative path host.js as $HOME/host.js.

This fix prefixes the host.js filename with the directory of the run.sh file. Now it works regardless of the working directory and regardless of the directory in which run.sh and the JavaScript files are located (as long as they are in the same location).

Fix: andy-portmen/native-client#118

izderadicka commented 4 months ago

I do have same problem - this PR fixes it - please merge.

yoyoma2 commented 4 months ago

I couldn't run the extension on ubuntu 24.04 LTS this fixed it. Please merge and release this. Thanks.