browser-extension plugin for vue-cli
Transforms the project into a browser extension.
The following structure will be generated when installing this plugin.
src/
└── extension/
├── background/
| ├── background.html
| └── background.js
├── content/
| └── content.js
└── manifest.json
A common need for extensions is to have a single long-running script to manage some task or state. Background pages to the rescue.
background.js is included in background.html.
Content scripts are JavaScript files that run in the context of web pages. By using the standard Document Object Model (DOM), they can read details of the web pages the browser visits, or make changes to them.
Every extension has a JSON-formatted manifest file, named manifest.json, that provides important information.
vue add simple-extension
npm run build