Answer the question
In order to leave comments, you need to log in
How can I make the script in "content_scripts" be executed in the chrome api so that when the button in "popup.html" is clicked?
Hello!
here is the code snippet in manifest.json :
"content_scripts": [
{
"matches": ["<all_urls>"],
"js": ["jquery.js", "script.js"]
}
]
alert('hello')
<button>alert</button>
Answer the question
In order to leave comments, you need to log in
If I remember correctly, content_scripts are scripts that are embedded in a page in an open tab, and popup.html is a different page, and it has different scripts. Communication between these pages must be done in other ways https://developer.chrome.com/apps/messaging
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question