abhijithvijayan/web-extension-starter

πŸ–₯πŸ”‹Web Extension starter to build "Write Once Run on Any Browser" extension

TypeScript

2,189

267 commits

updated Sep 13, 2026

See the code

README

πŸš€ web-extension-starter

Web Extension starter to build "Write Once Run on Any Browser" extension

πŸ™‹β€β™‚οΈ Made by @abhijithvijayan

Donate: PayPal, Patreon

Buy Me a Coffee


❀️ it? ⭐️ it on GitHub or Tweet about it.

Features

  • Cross Browser Support (Web-Extensions API)
  • Browser Tailored Manifest generation
  • Vite for fast builds and HMR
  • Automatic build on code changes
  • Auto packs browser specific build files
  • SASS/SCSS styling with CSS Modules
  • TypeScript by default
  • ES6 modules support
  • React 19 with automatic JSX runtime
  • ESLint 9 flat config with Prettier

Tech Stack

Browser Support

This starter uses Manifest V3 for all browsers.

ChromeFirefoxOperaEdgeBrave
88+ (Jan 2021)112+ (Apr 2023)74+ (Chromium-based)88+ (Chromium-based)Latest (Chromium-based)

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.

Used by extensions in production that has over 100,000+ users.

Use this template

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

πŸš€ Quick Start

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

Project Structure

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

Development

Loading the Extension

Chrome

  1. Navigate to chrome://extensions
  2. Enable "Developer mode"
  3. Click "Load unpacked"
  4. Select extension/chrome directory

Firefox

  1. Navigate to about:debugging
  2. Click "This Firefox"
  3. Click "Load Temporary Add-on"
  4. Select extension/firefox/manifest.json

Content Scripts

Content 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.

Browser-Specific Manifest

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.

Scripts

ScriptDescription
npm run dev:chromeStart dev server for Chrome
npm run dev:firefoxStart dev server for Firefox
npm run build:chromeBuild production Chrome extension
npm run build:firefoxBuild production Firefox addon
npm run buildBuild for all browsers
npm run lintRun ESLint
npm run lint:fixRun ESLint with auto-fix

Linting & TypeScript Config

Bugs

Please file an issue here for bugs, missing documentation, or unexpected behavior.

License

MIT Β© Abhijith Vijayan

boilerplate
chrome
chrome-extension
chrome-extension-react
cross-browser
edge
extension
firefox
firefox-addon
hacktoberfest
opera-extension
react-extension
reactjs
sass
starter
typescript
vitejs
web
web-extensions
web-extension-starter

abhijithvijayan/web-extension-starter

πŸ–₯πŸ”‹Web Extension starter to build "Write Once Run on Any Browser" extension

TypeScript

2,189

267 commits

updated Sep 13, 2026

See the code

README

πŸš€ web-extension-starter

Web Extension starter to build "Write Once Run on Any Browser" extension

πŸ™‹β€β™‚οΈ Made by @abhijithvijayan

Donate: PayPal, Patreon

Buy Me a Coffee


❀️ it? ⭐️ it on GitHub or Tweet about it.

Features

  • Cross Browser Support (Web-Extensions API)
  • Browser Tailored Manifest generation
  • Vite for fast builds and HMR
  • Automatic build on code changes
  • Auto packs browser specific build files
  • SASS/SCSS styling with CSS Modules
  • TypeScript by default
  • ES6 modules support
  • React 19 with automatic JSX runtime
  • ESLint 9 flat config with Prettier

Tech Stack

Browser Support

This starter uses Manifest V3 for all browsers.

ChromeFirefoxOperaEdgeBrave
88+ (Jan 2021)112+ (Apr 2023)74+ (Chromium-based)88+ (Chromium-based)Latest (Chromium-based)

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.

Used by extensions in production that has over 100,000+ users.

Use this template

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

πŸš€ Quick Start

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

Project Structure

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

Development

Loading the Extension

Chrome

  1. Navigate to chrome://extensions
  2. Enable "Developer mode"
  3. Click "Load unpacked"
  4. Select extension/chrome directory

Firefox

  1. Navigate to about:debugging
  2. Click "This Firefox"
  3. Click "Load Temporary Add-on"
  4. Select extension/firefox/manifest.json

Content Scripts

Content 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.

Browser-Specific Manifest

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.

Scripts

ScriptDescription
npm run dev:chromeStart dev server for Chrome
npm run dev:firefoxStart dev server for Firefox
npm run build:chromeBuild production Chrome extension
npm run build:firefoxBuild production Firefox addon
npm run buildBuild for all browsers
npm run lintRun ESLint
npm run lint:fixRun ESLint with auto-fix

Linting & TypeScript Config

Bugs

Please file an issue here for bugs, missing documentation, or unexpected behavior.

License

MIT Β© Abhijith Vijayan

boilerplate
chrome
chrome-extension
chrome-extension-react
cross-browser
edge
extension
firefox
firefox-addon
hacktoberfest
opera-extension
react-extension
reactjs
sass
starter
typescript
vitejs
web
web-extensions
web-extension-starter

Project health

Overall

3.8/10

Maintained

10/10

Code review

0/10
OpenSSF Scorecard

Significant stargazers

Ferhat Elmas

329 followers Β· starred Jan 2020

Josh McKinney

335 followers Β· starred Jan 2023

Yuval Kohavi

98 followers Β· starred Apr 2020

Zearin

79 followers Β· starred Aug 2020