π₯πWeb Extension starter to build "Write Once Run on Any Browser" extension
TypeScript
2,189
267 commits
updated Sep 13, 2026
Web Extension starter to build "Write Once Run on Any Browser" extension
β€οΈ it? βοΈ it on GitHub or Tweet about it.
This starter uses Manifest V3 for all browsers.
Note: Firefox 112+ is required for Manifest V3 support with ES modules in background scripts.
Need to support older Firefox versions? See Firefox MV2 Guide for using Manifest V2 with Firefox.
Create a new directory and run
curl -fsSL https://github.com/abhijithvijayan/web-extension-starter/archive/react-typescript-vite.tar.gz | tar -xz --strip-components=1
Ensure you have Node.js 20 or later installed.
Then run the following:
# Install dependencies
npm install
# Start development server
npm run dev:chrome # For Chrome
npm run dev:firefox # For Firefox
# Build for production
npm run build:chrome # Build Chrome extension
npm run build:firefox # Build Firefox addon
npm run build # Build for all browsers
source/
βββ Background/ # Service worker (Chrome MV3) / Background script (Firefox)
βββ ContentScript/ # Content scripts (injected into web pages)
βββ Popup/ # Extension popup UI
βββ Options/ # Options page UI
βββ components/ # Shared React components
βββ styles/ # Global styles and variables
βββ types/ # TypeScript type definitions
βββ utils/ # Utility functions
βββ public/ # Static assets (icons, etc.)
βββ manifest.json # Extension manifest template
chrome://extensionsextension/chrome directoryabout:debuggingextension/firefox/manifest.jsonContent scripts are automatically bundled as IIFE (Immediately Invoked Function Expression) to ensure compatibility with the browser's content script execution environment, which doesn't support ES modules.
The manifest uses vendor prefixes to generate browser-specific configurations:
{
"__chrome__name": "My Chrome Extension",
"__firefox__name": "My Firefox Addon",
"__chrome|firefox__description": "Works on both!"
}
See vite-plugin-wext-manifest for more details.
| Script | Description |
|---|---|
npm run dev:chrome | Start dev server for Chrome |
npm run dev:firefox | Start dev server for Firefox |
npm run build:chrome | Build production Chrome extension |
npm run build:firefox | Build production Firefox addon |
npm run build | Build for all browsers |
npm run lint | Run ESLint |
npm run lint:fix | Run ESLint with auto-fix |
@abhijithvijayan/eslint-config@abhijithvijayan/tsconfigPlease file an issue here for bugs, missing documentation, or unexpected behavior.
MIT Β© Abhijith Vijayan
329 followers Β· starred Jan 2020
335 followers Β· starred Jan 2023
98 followers Β· starred Apr 2020
79 followers Β· starred Aug 2020
π₯πWeb Extension starter to build "Write Once Run on Any Browser" extension
TypeScript
2,189
267 commits
updated Sep 13, 2026
Web Extension starter to build "Write Once Run on Any Browser" extension
β€οΈ it? βοΈ it on GitHub or Tweet about it.
This starter uses Manifest V3 for all browsers.
Note: Firefox 112+ is required for Manifest V3 support with ES modules in background scripts.
Need to support older Firefox versions? See Firefox MV2 Guide for using Manifest V2 with Firefox.
Create a new directory and run
curl -fsSL https://github.com/abhijithvijayan/web-extension-starter/archive/react-typescript-vite.tar.gz | tar -xz --strip-components=1
Ensure you have Node.js 20 or later installed.
Then run the following:
# Install dependencies
npm install
# Start development server
npm run dev:chrome # For Chrome
npm run dev:firefox # For Firefox
# Build for production
npm run build:chrome # Build Chrome extension
npm run build:firefox # Build Firefox addon
npm run build # Build for all browsers
source/
βββ Background/ # Service worker (Chrome MV3) / Background script (Firefox)
βββ ContentScript/ # Content scripts (injected into web pages)
βββ Popup/ # Extension popup UI
βββ Options/ # Options page UI
βββ components/ # Shared React components
βββ styles/ # Global styles and variables
βββ types/ # TypeScript type definitions
βββ utils/ # Utility functions
βββ public/ # Static assets (icons, etc.)
βββ manifest.json # Extension manifest template
chrome://extensionsextension/chrome directoryabout:debuggingextension/firefox/manifest.jsonContent scripts are automatically bundled as IIFE (Immediately Invoked Function Expression) to ensure compatibility with the browser's content script execution environment, which doesn't support ES modules.
The manifest uses vendor prefixes to generate browser-specific configurations:
{
"__chrome__name": "My Chrome Extension",
"__firefox__name": "My Firefox Addon",
"__chrome|firefox__description": "Works on both!"
}
See vite-plugin-wext-manifest for more details.
| Script | Description |
|---|---|
npm run dev:chrome | Start dev server for Chrome |
npm run dev:firefox | Start dev server for Firefox |
npm run build:chrome | Build production Chrome extension |
npm run build:firefox | Build production Firefox addon |
npm run build | Build for all browsers |
npm run lint | Run ESLint |
npm run lint:fix | Run ESLint with auto-fix |
@abhijithvijayan/eslint-config@abhijithvijayan/tsconfigPlease file an issue here for bugs, missing documentation, or unexpected behavior.
MIT Β© Abhijith Vijayan
329 followers Β· starred Jan 2020
335 followers Β· starred Jan 2023
98 followers Β· starred Apr 2020
79 followers Β· starred Aug 2020