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

not work for content.js in chrome 66 #50

Open
lessfish opened this issue Apr 24, 2018 · 2 comments
Open

not work for content.js in chrome 66 #50

lessfish opened this issue Apr 24, 2018 · 2 comments

Comments

@lessfish
Copy link

this repo is awesome! and it works quite fine with popup.js, bg.js, but it may not work in content.js in chrome 66, I am not sure if it's an issue of chrome or this repo, when i include a content.js file, after the file modified, I should refresh the certain extension in the page chrome://extensions/, some days ago reloading the page chrome://extensions/ is enough

@lessfish
Copy link
Author

nobody?

@nickforddev
Copy link

I just noticed the same problem, the problem is that the webpack config isn't set up to include the additional content script during build.

I got it to work by adding the content script to wepack.config.js on line 26:

entry: {
    popup: path.join(__dirname, "src", "js", "popup.js"),
    options: path.join(__dirname, "src", "js", "options.js"),
    background: path.join(__dirname, "src", "js", "background.js"),
    content: path.join(__dirname, "src", "js", "content.js")
}

Note that by defauly webpack will use the filename content.bundle.js, so I just used that filename in manifest.json:

"content_scripts": [{
    "matches": ["*://*.stackoverflow.com/*"],
    "js": ["content.bundle.js"]
}]

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

2 participants