English · 简体中文
An opinionated React starter built on top of the official Extension.js React template, with the batteries I reach for on every project already included.
The official Extension.js React template is intentionally minimal. This fork keeps its structure and layers commonly-needed capabilities on top, so a fresh extension starts with docs-aware AI tooling and browser debugging already wired up — no per-project setup.
Baseline (from the official template)
- React 19 + TypeScript
- Manifest V3 on Chromium — an MV3 service-worker background, the
side_panelsidebar, and a content script injected into all pages. - Cross-browser builds for Chrome / Firefox / Edge
Changed from the official template
- Firefox on Manifest V3 — the official template ships Firefox as Manifest V2. This fork migrates it to MV3 (Firefox 109+ supports MV3 and Extension.js builds it), so there's no MV2 fallback. The single manifest still resolves per target: on Firefox the background becomes an event-page
background.scriptsand the sidebar becomessidebar_action.
Publishing to Firefox Add-ons (AMO) may need a stable extension ID — add
browser_specific_settings.gecko.idtosrc/manifest.jsonfor that. It isn't needed for local development.
Added integrations
- AI docs access — the hosted Extension.js docs MCP server, so your editor/assistant answers "how do I…" from current documentation instead of stale training data. See AI access.
- Chrome DevTools MCP — runs Google's
chrome-devtools-mcpalongside the Extension.js control server (@extension.dev/mcp), giving AI agents raw Chrome debugging plus build-aware, cross-browser extension control from one config. See Chrome DevTools MCP with Extension.js. - Tailwind CSS — utility-first styling wired through PostCSS, so you can use utility classes in components out of the box. See Styling and Tailwind CSS with Extension.js.
- shadcn/ui — accessible, copy-into-your-project components built on Tailwind, pre-wired (
components.json, the@/path alias, and acn()helper) so you can drop components intosrc/components/uiand use them right away. See Styling and shadcn/ui with Extension.js. - ESLint — a flat-config (
eslint.config.ts) lint setup covering JS/TS, React, JSON, Markdown, and CSS. It runs outside the build pipeline viapnpm run lint, with a companionpnpm run type-checkfortsc. See Commands and ESLint with Extension.js.
The integrations above are declared in .mcp.json and picked up automatically by Claude Code (and other MCP-compatible clients pointed at the same config).
| Server | Transport | What it gives the assistant |
|---|---|---|
extensionjs |
HTTP (hosted) | Searches the Extension.js docs and answers questions from current content. |
extension-dev |
stdio (@extension.dev/mcp) |
Build-aware, cross-browser extension control: dev server, hot reload, generated manifest, storage, and logs across every context. |
chrome-devtools |
stdio (chrome-devtools-mcp) |
Raw Chrome debugging over CDP: drive pages, inspect network/performance, plus extension tools. |
The
chrome-devtoolsserver is configured with--browser-url=http://127.0.0.1:9222, so it attaches to a Chrome instance already listening on that remote debugging port. Launch such a browser before using those tools.
A rule of thumb for which to use: if the task touches your project (source, build, manifest, reload), reach for extension-dev; if it touches the browser generically (pages, network, performance), reach for chrome-devtools.
Tailwind CSS v4 is wired through PostCSS:
postcss.config.mjsregisters the@tailwindcss/postcssplugin.src/styles/globals.csspulls in Tailwind and defines the theme.
Import globals.css from an entry point (the sidebar already does), then use utility classes directly in your components. See Tailwind CSS with Extension.js for details.
shadcn/ui sits on top of Tailwind and lets you pull accessible components straight into your own source tree. The wiring is already in place:
components.json— configuration for the shadcn CLI (style, base color, the@/alias, Lucide icons).tsconfig.jsonmaps the@/*alias tosrc/*, where generated components import from.src/lib/utils.tsexports thecn()helper for merging class names.src/styles/globals.cssimportsshadcn/tailwind.cssandtw-animate-css, and defines the light/dark design tokens (CSS variables).
Add components with the shadcn CLI and they land in src/components/ui:
pnpm dlx shadcn@latest add buttonThen import them through the @/ alias:
import {Button} from '@/components/ui/button'See shadcn/ui with Extension.js for details.
Run the extension in development mode. Target a browser with --browser:
pnpm run dev # Chromium (default)
pnpm run dev -- --browser=firefox
pnpm run dev -- --browser=edgeBuild for production. Convenience scripts target each browser:
pnpm run build # Chrome (default)
pnpm run build:firefox
pnpm run build:edgePreview the production build in the browser:
pnpm run previewCheck code quality with ESLint, and type-check separately with tsc:
pnpm run lint
pnpm run type-check