chrome-extension-webpack-boilerplate
chrome-extension-webpack-boilerplate copied to clipboard
not work for content.js in chrome 66
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
nobody?
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"]
}]