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

Autoreload JS file alone #11

Closed
zurfyx opened this issue Apr 8, 2017 · 3 comments
Closed

Autoreload JS file alone #11

zurfyx opened this issue Apr 8, 2017 · 3 comments

Comments

@zurfyx
Copy link

zurfyx commented Apr 8, 2017

First of all, your boilerplate looks really good! 👍

However, in a specific case I am required to load some JavaScript even before the page is rendered. Thus, making background.html unsuitable.

  "content_scripts": [{
    "js": ["page-load.bundle.js"],
    "matches": ["<all_urls>"],
    "run_at": "document_start",
    "all_frames": true
  }],

According to the chrome extension documentation I can use nothing but JS and CSS files

How would you do it in this case?

Webpack compilation was simply about adding a new entry "page-load": path.join(__dirname, "src", "js", "page-load.js") but I don't see how to make the extension get this latest version of the .js file without having to reload the extension (or if there are better ways to do this).

@samuelsimoes
Copy link
Owner

If I understood your problem, AFIY there's no way to automatic reload injected scripts except to reload the whole extension. I know, it's a shame.

Besides that, you must read the content scripts section in the readme before start using content scripts.

@samuelsimoes
Copy link
Owner

Closing. I think it's resolved.

@howardya
Copy link

howardya commented Sep 3, 2017

@zurfyx please refer to my comment here for hot reloading content script.

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

No branches or pull requests

3 participants