Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use web-ext to run an extension in Google Chrome #809

Closed
kumar303 opened this issue Feb 15, 2017 · 13 comments
Closed

Use web-ext to run an extension in Google Chrome #809

kumar303 opened this issue Feb 15, 2017 · 13 comments

Comments

@kumar303
Copy link
Contributor

Is this a bug or feature request?

feature

What is the current behavior?

You can use web-ext run to launch an extension for development in Firefox. It creates a temporary profile and will automatically reload the extension when you change the source.

What is the expected or desired behavior?

It would be great to use web-ext to launch the extension like this in Chrome. I'm not sure if we can support auto-reloading or temporary profiles but at the very least we could launch chromium --load-extension=/path/to/source-dir which does a similar temporary installation for development.

@kumar303
Copy link
Contributor Author

If Chrome doesn't have remote debugger support for auto-reloading, here is one idea for an epic, horrendous hack:

  • create a helper Chrome Extension that can listen to commands from web-ext
  • install the helper extension along with the extension under test
  • whenever the source changes, web-ext would tell the Chrome Extension to automatically click the 'reload' button on the chrome://extensions/ page (Extensions may not have access to run content scripts on this page though)

@AgrimPrasad
Copy link

AgrimPrasad commented Feb 16, 2017

Hacky idea for auto-reloading which was previously implemented for Chrome: https://60devs.com/hot-reloading-for-chrome-extensions.html

Source: https://github.com/xpl/crx-hotreload/blob/master/hot-reload.js

@kumar303
Copy link
Contributor Author

Wow, that's cool. Thanks for the link. I guess the downside is that one would have to modify their extension source to use this approach.

@josephfrazier
Copy link

For OctoLinker, we use chrome-launch to start an isolated instance of Chrome with the extension loaded. Here's the code, if you're interested in adapting it: https://github.com/OctoLinker/browser-extension/blob/08bd7aebe3fc43c96690c2ca0dab14398810c424/scripts/chrome-launch.js

@lutostag
Copy link

lutostag commented Jun 3, 2017

Chrome (well a symlink to chromium on my rig) does reload the extension when I run with the following...
chrome --temp-profile --password-store=basic --load-extension=<dir> about:blank
Have used it for active debugging here.

version: Chromium 58.0.3029.110 Built on Ubuntu , running on Ubuntu 17.04

@DamienCassou
Copy link

@josephfrazier Thanks for the link. Apparently, chrome-launch does not support Chromium, only Chrome.

@DamienCassou
Copy link

DamienCassou commented Aug 6, 2017

Also, chrome-launch passes a new directory as default value for --user-data-dir which is not compatible with native messages (they require a manifest file per native application in <user-data-dir>/NativeMessagingHost: hughsk/chrome-launch#7.

@Miserlou
Copy link

Status of this feature? Would be super handy!

@kumar303
Copy link
Contributor Author

There are some changes in #868 that will make it easier to start working on Chrome support.

@heikir
Copy link

heikir commented Oct 30, 2018

@kumar303 Any updates on this feature request? Is it currently high or low priority?

@kumar303
Copy link
Contributor Author

@rpl would probably be able to say! I think we are close.

@rpl
Copy link
Member

rpl commented Sep 19, 2019

Fixed by #1392 \o/

@rpl rpl closed this as completed Sep 19, 2019
@rpl
Copy link
Member

rpl commented Sep 19, 2019

This is already merged on master (and so if you want to try it before it is released on npm, you can built web-ext from the master branch), and it will soon be part of the upcoming web-ext 3.2.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants