-
Notifications
You must be signed in to change notification settings - Fork 76
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
Content Script is not loading #95
Comments
There's been a bit of confusion around this, so I probably need to make the docs more clear around the boilerplate. The default setup should execute your content script when you click on the browser action button. Most developers are expecting their content scripts to be automatically injected on every page, but given that requires special permissions when you publish the extension and it is my belief that if developers start with the most open permissions, they will not ever revisit and trim it down to only what is necessary. If automatically injecting your content script is something you wanted to do, here's the chrome docs for what your manifest file needs to include: https://developer.chrome.com/extensions/content_scripts#declaratively |
@adambullmer Do you mean when pressing the extension button, so that the popup opens? Because if so, that also doesn't work. But perhaps I am misunderstanding what you mean. I've read over the docs and made permissions very open (as can be seen in my manifest), so I am not sure that's the cause here. I've tried all kinds of communications, but it never works |
Dropping the following in the "content_scripts": [
{
"matches": [
"<all_urls>"
],
"js": [
"js/content-script.js"
]
}
], |
@doutatsu Did you solve this? I'm having the same issue. |
manifest.json: |
Same issue for me as @myrccar |
I am trying to use a content script but to no avail. I've used the boilerplate setup and I can see it being compiled, but no code gets executed in the content script.
I have also used alert and
console.log
in the background script, to confirm the listener is working and it does. All that doesn't work, is executing script from a file. I even used it with some inline code, to see ifexecuteScript
on it's own works, and it does...Content script
Background
Manifest
Compiled result
The text was updated successfully, but these errors were encountered: