intoli / remote-browser

A low-level browser automation framework built on top of the Web Extensions API standard.
Other
1.73k stars 105 forks source link

Add the possibility to set a custom extension path #67

Closed matyo91 closed 6 years ago

matyo91 commented 6 years ago

When using launcher, we can set a custom path to locate the extension folder.

sangaline commented 6 years ago

Thanks for submitting a pull request. We're actually working on some broader refactoring in general that will make it easier to specify things like command line arguments and other browser settings (see: #55). Just out of curiosity, what's your use-case for changing the extension directory? Are you using a custom build of the extension, or adding additional content scripts? We might be able to find a way to provide your desired functionality through the library's API rather than needing to customize the extension itself.

matyo91 commented 6 years ago

Hi, to answer the question, i'm currently not using a custom extension. All work fine if you clone the directory and work inside. But if you consider yarn install remote-browser, here is an instance of a simple case :

# node.js
var launchChrome = require('remote-browser').launchChrome
launchChrome('http://www.google.fr')

Then :

$ yarn add remote-browser
$ node node.js

It will be ./node_modules/remote-browser/index.js that will be loaded, and the script will not find the directory ../dist/extension relatively from ./node_modules/remote-browser/index.js file.

That why i wanted to add a custom extension path.

sangaline commented 6 years ago

Thanks, that's definitely not the intended behavior. We'll get a fix for the underlying problem out ASAP.

sangaline commented 6 years ago

This behavior should be fixed in v0.0.13, please let me know if you're still running into issues. We will add the ability to add additional extensions in the near future, but it's part of a larger refactoring of the interface.