A modern browser extension template built with WXT framework, React 19, and TypeScript. This extension provides a robust foundation for cross-browser development with modern tooling and best practices.
- WXT Framework - Modern web extension framework
- React 19 - Latest React with concurrent features
- TypeScript - Type-safe JavaScript development
- Tailwind CSS 4 - Utility-first CSS framework
- shadcn/ui - Re-usable UI components built with Radix UI
- pnpm - Fast, disk space efficient package manager
- Lucide React - Beautiful & consistent icon library
- Cross-browser compatibility (Chrome, Firefox, Safari, Edge)
- Modern React 19 with TypeScript
- Tailwind CSS for styling
- shadcn/ui component library
- Background scripts and content scripts
- Popup interface
- Hot module replacement for development
- Built-in permissions management
- Node.js 16+ or 18+ recommended
- pnpm (recommended) or npm
-
Clone the repository
git clone <repository-url> cd Xtension
-
Install dependencies
pnpm install
Or with npm:
npm install
-
Configure the extension
Edit
wxt.config.tsto customize your extension:manifest: { name: "Your Extension Name", description: "Your extension description", version: "1.0.0" }
# For Chrome/Chromium
pnpm dev
# For Firefox
pnpm dev:firefoxChrome/Edge:
- Open
chrome://extensions/ - Enable "Developer mode"
- Click "Load unpacked"
- Select the
.output/chrome-mv3directory
Firefox:
- Open
about:debugging - Click "This Firefox"
- Click "Load Temporary Add-on"
- Select the
manifest.jsonfrom.output/firefox-mv2directory
# Build for Chrome/Chromium
pnpm build
# Build for Firefox
pnpm build:firefox
# Create distribution zip
pnpm zip
pnpm zip:firefoxsrc/
├── entrypoints/ # Extension entry points
│ ├── background/ # Background scripts
│ ├── content/ # Content scripts
│ ├── popup/ # Extension popup
│ └── *.css # Global styles
├── components/ # React components
│ └── ui/ # shadcn/ui components
├── hooks/ # Custom React hooks
├── lib/ # Utility functions
└── assets/ # Static assets
pnpm dev- Start development server (Chrome)pnpm dev:firefox- Start development server (Firefox)pnpm build- Build for production (Chrome)pnpm build:firefox- Build for production (Firefox)pnpm zip- Create distribution zip (Chrome)pnpm zip:firefox- Create distribution zip (Firefox)pnpm compile- Type check without emitting
The extension includes the following permissions:
storage- Local/sync storage accessscripting- Script injection capabilitiestabs- Tab information accesscontextMenus- Context menu integrationactiveTab- Active tab access
This project uses shadcn/ui. To add new components:
npx shadcn@latest add button
npx shadcn@latest add cardTailwind CSS is configured with custom design tokens. Global styles are in src/entrypoints/global.css.
Create new entry points in src/entrypoints/ following WXT conventions:
- Background scripts:
background/ - Content scripts:
content/ - Popup/Options pages:
popup/,options/
- Chrome 88+
- Firefox 109+
- Safari 14+
- Edge 88+
- Fork the repository
- Create a feature branch
- Make your changes
- Run type checking:
pnpm compile - Test in both Chrome and Firefox
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.