https://github.com/ginmu/extension-demo
The demo is to check chrome extension whether installed and how to send and receive messages from web page
https://github.com/ginmu/extension-demo
Last synced: 2 months ago
JSON representation
The demo is to check chrome extension whether installed and how to send and receive messages from web page
- Host: GitHub
- URL: https://github.com/ginmu/extension-demo
- Owner: GinMu
- License: mit
- Created: 2020-05-19T08:48:38.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T06:21:34.000Z (over 2 years ago)
- Last Synced: 2025-02-15T04:57:54.188Z (4 months ago)
- Language: JavaScript
- Size: 2.39 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 19
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# extension-demo
The demo is to check chrome extension whether installed and how to send and receive messages from web page
## 检查 extension 是否安装
1. 通过[contentscript](https://github.com/GinMu/extension-demo/blob/master/src/contentscript.js)向当前网页注入脚本, 通过全局变量判断是否安装.
## 网页如何向 extension 发送消息
1. 通过[background](https://github.com/GinMu/extension-demo/blob/master/src/background.js)下`onMessageExternal`事件.
## 参考
1. [Chrome Extension](https://developer.chrome.com/extensions)
2. [Chrome Extension Content Scripts](https://developer.chrome.com/extensions/content_scripts)
3. [Chrome Extension Message Passing](https://developer.chrome.com/extensions/messaging)
4. [Generate Vue Template](https://github.com/Kocal/vue-web-extension)