-
Notifications
You must be signed in to change notification settings - Fork 134
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
How to run the content script for the first time? #7
Comments
You need to manually inject your content script(.js) and style(.css) in all tabs when the extension will install. Make use of chrome.runtime.onInstalled in background.js
Hope this helps |
Thanks for the reply. WIll try this 👍 |
@satendra02 when I copy pasted your code into |
Line 47 is checking whether the current tab has any URL in the address bar or not. Modify this line like below and it will work.
Or, If you want to load your extension on an empty page as well. Simply remove the |
When I install the chrome extension, the content script does not run on the tabs that were
already present. The tabs should be reloaded before the script works. Is there a solution?
The text was updated successfully, but these errors were encountered: