MCPcopy Index your code
hub / github.com/abhijithvijayan/web-extension-starter

github.com/abhijithvijayan/web-extension-starter @v3.0.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v3.0.0 ↗ · + Follow
41 symbols 84 edges 22 files 0 documented · 0% updated 3mo agov3.0.0 · 2026-02-03★ 2,1781 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

🚀 web-extension-starter

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

LICENSE TWEET

🙋‍♂️ 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.

Chrome Firefox Opera Edge Brave
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

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

Linting & TypeScript Config

Bugs

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

License

MIT © Abhijith Vijayan

Extension points exported contracts — how you extend this code

StorageSchema (Interface)
(no doc)
source/types/storage.ts
InputProps (Interface)
(no doc)
source/components/Input/Input.tsx
TabData (Interface)
(no doc)
source/Popup/Popup.tsx
PageInfo (Interface)
(no doc)
source/types/messages.ts
ButtonProps (Interface)
(no doc)
source/components/Button/Button.tsx
FooterActionsProps (Interface)
(no doc)
source/Popup/components/FooterActions/FooterActions.tsx
GetPageInfoMessage (Interface)
(no doc)
source/types/messages.ts
CardProps (Interface)
(no doc)
source/components/Card/Card.tsx

Core symbols most depended-on inside this repo

getStorage
called by 5
source/utils/storage.ts
getOutDir
called by 3
vite.config.ts
openWebPage
called by 3
source/Popup/Popup.tsx
getExtensionZipFileName
called by 2
vite.config.ts
setStorage
called by 2
source/utils/storage.ts
getPageInfo
called by 2
source/ContentScript/index.ts
buildIIFEScripts
called by 1
vite.config.ts
getInitial
called by 1
source/Popup/components/TabInfo/TabInfo.tsx

Shape

Function 24
Interface 17

Languages

TypeScript100%

Modules by API surface

source/types/messages.ts6 symbols
vite.config.ts4 symbols
source/Popup/Popup.tsx4 symbols
source/utils/storage.ts3 symbols
source/Popup/components/TabInfo/TabInfo.tsx3 symbols
source/components/icons/SettingsIcon.tsx2 symbols
source/components/icons/HeartIcon.tsx2 symbols
source/components/icons/GitHubIcon.tsx2 symbols
source/components/Input/Input.tsx2 symbols
source/components/Checkbox/Checkbox.tsx2 symbols
source/components/Card/Card.tsx2 symbols
source/components/Button/Button.tsx2 symbols

For agents

$ claude mcp add web-extension-starter \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page