به توسعه برنامههام ازش استفاده میکنم
saeb a32a6c9abe defines | 2 years ago | |
---|---|---|
background | 2 years ago | |
icons | 2 years ago | |
.gitignore | 2 years ago | |
README.md | 2 years ago | |
content.js | 2 years ago | |
defines.js | 2 years ago | |
manifest.json | 2 years ago |
This extension includes a content script, which is injected only into: "https://mdn.github.io/webextensions-examples/content-script-page-script-messaging.html".
The content script listens for clicks on a particular button on the page. When the button is clicked, the content script sends a message to any scripts running in the page.
Conversely, the content script listens for messages from the same window posted using window.postMessage. When the content script receives such a message, it displays an alert.
To test it out, visit https://mdn.github.io/webextensions-examples/content-script-page-script-messaging.html and press the buttons. One button sends a message from the page script to the content script, the other button sends a message in the other direction.
How to exchange messages between an extension's content scripts, and scripts running in a web page.