We're developing a new and improved browser extension template with exciting features like authentication, payment processing, and more. Your feedback is crucial to us! Thank you for your time and support!
Note: Your responses will help shape the future of this project and ensure we meet your needs better.
A Vite powered WebExtension (Chrome, FireFox, etc.) starter template based on manifest 3
, vue3
and vite
.
Script setup
and more!onInstall
& onUpdate
pagesTailwind
css And daisyUI
unplugin-vue-router
for automatic route registrationwebext-bridge
Eslint
& Prettier
configured for vue
, javascript
, TypeScript
Please create an issue if you feel some feature is missing or could be improved.
unplugin-vue-router
- File system based route generator for Viteunplugin-auto-import
- Directly use browser
and Vue Composition API without importingunplugin-vue-components
- components auto importunplugin-icons
- icons as componentsTailwind css forms
and typography
plugins are enabled for default styling of form controls.
webext-bridge
- effortlessly communication between contexts<script setup>
SFC syntaxsetup
SFC syntax in Pinia storesCreate a repo from this template on GitHub.
If you prefer to do it manually with the cleaner git history
If you don't have pnpm installed, run: npm install -g pnpm
pnpx degit mubaidr/vite-vue3-browser-extension-v3 my-webext
cd my-webext
pnpm i
src
- main source.
content-script
- scripts and components to be injected as content_script
iframe
content script iframe vue3 app which will be injected into pagebackground
- scripts for background.popup
- popup vuejs application rootpages
- popup pagesoptions
- options vuejs application rootpages
- options pagessetup
- Page for Install and Update extension eventspages
- pages for install and update eventsoffscreen
- extension offscreen pages, can be used for audio, screen recording etcpages
- application pages, common to all views (About, Contact, Authentication etc)components
- auto-imported Vue components that are shared in popup and options page.assets
- assets used in Vue componentsdist
- built files
chrome
- Chrome extension, can be publishd to Opera, Edge and toher chromium based browsers store etcfirefox
- Firefox extensionmanifest.config.ts
- Base extension manifest with common configurationmanifest.chrome.config.ts
- Chrome/ chromium based browsers specific manifestmanifest.firefox.config.ts
- Firefox spefic manifestvite.config.ts
- Base vite configurationvite.chrome.config.ts
- Chrome/ chromium based browsers specific vite configurationvite.firefox.config.ts
- Firefox specific vite configurationpnpm dev
- Start development serverpnpm build
- Build extensionpnpm lint
- Lint filesYou can also use pnpm dev:chrome, pnpm dev:firefox, pnpm build:chrome, pnpm build:firefox, pnpm lint:fix
In src/background/index.ts you can find an example of chrome.runtime.onInstalled.addListener.
We add ?type
to the url to tell if it's update or install event. Then in src/setup/pages/index.ts we check for the type
and show the appropriate page.
pnpm dev
Then load extension in browser with the dist/
folder.
To build the extension, run
pnpm build
And then pack files under dist/chrome
or dist/firefox
, you can upload to appropriate extension store.
Muhammad Ubaid Raza |
Jihoon Yi |
Diego Ponciano |
igorfz |
hi2code |
Null |