Gathering detailed insights and metrics for vue-cli-plugin-browser-extension
Gathering detailed insights and metrics for vue-cli-plugin-browser-extension
Gathering detailed insights and metrics for vue-cli-plugin-browser-extension
Gathering detailed insights and metrics for vue-cli-plugin-browser-extension
@rhilip/vue-cli-plugin-browser-extension
Browser extension development plugin for vue-cli 5.0
@lulibuli/vue-cli-plugin-browser-extension
Browser extension development plugin for vue-cli 5.0
@birdeatsbug/vue-cli-plugin-browser-extension
Browser extension development plugin for vue-cli 3.0
vue-cli-plugin-simple-extension
vue-cli plugin transform to browser extension
Browser extension development plugin for vue-cli 3.0
npm install vue-cli-plugin-browser-extension
Typescript
Module System
Node Version
NPM Version
JavaScript (90.97%)
Vue (7.29%)
HTML (1.74%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
LGPL-3.0 License
430 Stars
228 Commits
76 Forks
8 Watchers
3 Branches
8 Contributors
Updated on Jun 18, 2025
Latest Version
0.26.1
Package Id
vue-cli-plugin-browser-extension@0.26.1
Unpacked Size
1.11 MB
Size
1.08 MB
File Count
34
NPM Version
7.11.2
Node Version
12.13.1
Published on
Nov 03, 2023
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
Browser extension development plugin for vue-cli 3.x
This is intended to be a vue-cli@3.x replacement for Kocal/vue-web-extension v1
(now, Kocal/vue-web-extension is a preset using this plugin).
This plugin changes the serve
command for your vue applications.
This new command is only for running a livereload server while testing out your browser extension.
This removes the entrypoint of src/main.js
, and as such will not scaffold a general vue app.
Packaging and deploying will still be done with yarn build
and zipping in up for Chrome, Firefox, or whichever other browser you wish to develop for.
It makes some assumptions about your project setup. I hope to be able to scaffold an app so that identifying the below in unnecessary.
.
├── public/
│ ├── _locales/
│ │ └── en/
│ │ └── messages.json
│ ├── icons/
│ │ └── Icons for your extension. Should include a 16, 19, 38, 48, and 128px square image
│ └── browser-extension.html (default target html template)
├── src/
│ ├── assets/
│ │ └── Static assets in use in your app, like logo.png
│ ├── components/
│ │ └── HelloWorld.vue (modified)
│ ├── content-scripts
│ │ └── content-script.js
│ ├── devtools/ (asked during project generation)
│ │ ├── App.vue
│ │ └── main.js
│ ├── options/ (asked during project generation)
│ │ ├── App.vue
│ │ └── main.js
│ ├── popup/ (asked during project generation)
│ │ ├── App.vue
│ │ └── main.js
│ ├── override/ (asked during project generation)
│ │ ├── App.vue
│ │ └── main.js
│ └── standalone/ (asked during project generation)
│ ├── App.vue
│ └── main.js
├── background.js
└── manifest.json
If you wish to use the signing key functionality you will need to have openssl
available on your system.
This can be added to your vuejs project by one of the following methods:
vue ui
and searching for this projectvue add browser-extension
commandRunning the Livereload server.
This will build and write to the local dist
directory.
This plugin will respect the outputDir
setting, however it cannot read into passed CLI args, so if you require a custom output dir, be sure to add it in your vue.config.js
file.
You can then add this as an unpacked plugin to your browser, and will continue to update as you make changes.
NOTE: you cannot get HMR support in the popup window, however, closing and reopening will refresh your content.
1yarn serve 2yarn build
Plugin options can be set inside your vue.config.js
:
1// vue.config.js 2module.exports = { 3 pluginOptions: { 4 browserExtension: { 5 // options... 6 }, 7 }, 8};
components
Object.<string, boolean>
The browser extension components that will be managed by this plugin.
Valid components are:
1components: { 2 background: true, 3 contentScripts: true 4}
componentOptions
Object.<string, Object>
See Component options.
extensionReloaderOptions
Object.<string, Object>
See available options in webpack-extension-reloader.
manifestSync
Array<string>
['version']
Array containing names of manifest.json
keys that will be automatically synced with package.json
on build.
Currently, the only supported keys are version
and description
.
manifestTransformer
Function
Function to modify the manifest JSON outputted by this plugin.
An example use case is adding or removing permissions depending on which browser is being targeted.
1manifestTransformer: (manifest) => { 2 if (process.env.BROWSER === 'chrome') { 3 manifest.permissions.push('pageCapture'); 4 } 5 return manifest; 6};
modesToZip
Deprecated. Any mode will be zipped to the artifacts dir, when NODE_ENV=production
(the default in the normal yarn build
). For more information on how to set NODE_ENV=production
in other modes see Vue CLI docs – Example Staging Mode
artifactsDir
string
'./artifacts'
Directory where the zipped browser extension should get created.
artifactFilename
Function
({name, version, mode}) => `${name}-v${version}-${mode}.zip`
Optional function to generate a custom artifact filename. Useful for naming builds for different browsers.
The function takes a single object parameter containing:
name
- Name from package.json
version
- Version from package.json
mode
- Vue CLI mode such as 'production'For example,
1// vue.config.js 2module.exports = { 3 pluginOptions: { 4 browserExtension: { 5 artifactFilename: ({ name, version, mode }) => { 6 if (mode === 'production') { 7 return `${name}-v${version}-${process.env.BROWSER}.zip`; 8 } 9 return `${name}-v${version}-${process.env.BROWSER}-${mode}.zip`; 10 }, 11 }, 12 }, 13};
Some browser extension components have additional options which can be set as follows:
1// vue.config.js 2module.exports = { 3 pluginOptions: { 4 browserExtension: { 5 componentOptions: { 6 // <name of component>: <options> 7 // e.g. 8 contentScripts: { 9 entries: { 10 content1: 'src/content-script1.js', 11 content2: 'src/content-script2.js', 12 }, 13 }, 14 }, 15 }, 16 }, 17};
entry
string|Array<string>
Background script as webpack entry using the single entry shorthand syntax.
1background: { 2 entry: 'src/my-background-script.js'; 3}
entries
{[entryChunkName: string]: string|Array<string>}
Content scripts as webpack entries using using the object syntax.
1contentScripts: { 2 entries: { 3 'my-first-content-script': 'src/content-script.js', 4 'my-second-content-script': 'src/my-second-script.js' 5 } 6}
Some boilerplate for internationalization has been added. This follows the i18n (chrome|WebExtention) spec.
Provided for you is the default_locale
option in the manifest, and a _locales
directory.
There is some basic usage of it in the manifest, as well as in some of the boilerplate files.
Since this is largely an out of the box solution provided by the browsers, it is heavily encouraged to utilize it.
If you do not want to translate your app, simply delete the public/_locales
directory, and no longer use the browser.i18n
methods.
This plugin by default adds in the official mozilla webextension polyfill to the build. The opinion of this plugin is that developers should be building cross platform, and should have reasonable tooling to do so. By emphasizing cross platform first, your application will be adhering to the community standards, be ready for distribution to other extension stores, and avoid developing against browser APIs that may have no equivalent. The polyfill is a no-op on firefox, and only takes up 20.5kb unminified.
If you still feel strongly to not include the polyfill, then this is what you need to add to your webpack chain to do so.
vue.config.js
1module.exports = { 2 chainWebpack(config) { 3 config.plugins.delete('provide-webextension-polyfill'); 4 config.module.rules.delete('provide-webextension-polyfill'); 5 }, 6};
This library is following the standard styling of vue projects, and those are really the only tests to perform.
1yarn test
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 7/15 approved changesets -- score normalized to 4
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
43 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More