A modern browser extension development template built with SolidJS, Vite, and TypeScript, supporting Chrome, Firefox, and Edge browsers.
- 🌐 Multi-browser Support - Chrome, Firefox, Edge with one codebase
- ⚡ Modern Tech Stack - SolidJS + Vite + TypeScript + Tailwind CSS
- 📦 Manifest V3 - Follows the latest extension API standards
- 🔥 Hot Reload - Automatic extension refresh during development
- 🎨 Complete Page Support - Popup, Options, Background, Content Script, DevTools, Side Panel
- 💡 TypeScript Support - Full type hints and checking
- 🎯 ESLint + Prettier - Code formatting and quality checking
- 📱 Responsive Design - Modern UI built with Tailwind CSS
- 🛠️ Ready to Use - Pre-configured complete development environment
- Framework: SolidJS - High-performance reactive JavaScript library
- Build Tool: Vite - Lightning-fast frontend build tool
- Language: TypeScript - Typed JavaScript
- Styling: Tailwind CSS - Utility-first CSS framework
- Extension Plugin: @crxjs/vite-plugin - Chrome extension plugin for Vite
- Code Standards: ESLint + Prettier
src/
├── pages/
│ ├── background/ # Background script
│ ├── content/ # Content script
│ ├── devtools/ # Developer tools page
│ ├── newtab/ # New tab page
│ ├── options/ # Options page
│ ├── panel/ # Side panel
│ └── popup/ # Popup window
├── global.d.ts # Global type definitions
└── vite-env.d.ts # Vite environment types- Node.js >= 18
- pnpm (recommended) or npm/yarn
pnpm installpnpm startAfter starting the development server, extension files will be generated in the dist directory.
- Open
chrome://extensions/oredge://extensions/ - Enable "Developer mode"
- Click "Load unpacked"
- Select the project's
distdirectory
- Open
about:debugging#/runtime/this-firefox - Click "This Firefox"
- Click "Load Temporary Add-on"
- Select the
manifest.jsonfile in thedistdirectory
pnpm buildAfter building, the dist directory contains publishable extension files, and the zip directory contains packaged extension archives.
pnpm formatEdit the following files to customize your extension:
- package.json - Basic project information
- manifest.config.ts - Extension manifest configuration
- public/ - Icons and static assets
Modify the permissions array in manifest.config.ts to add or remove permissions:
permissions: ['tabs', 'storage', 'contextMenus', 'sidePanel']Configure content script matching rules in manifest.config.ts:
content_scripts: [
{
matches: ['<all_urls>'], // Change to your target websites
js: ['src/pages/content/index.ts'],
},
]- Popup (
src/pages/popup/) - Window shown when clicking the extension icon - Options (
src/pages/options/) - Extension settings page - Background (
src/pages/background/) - Background service script - Content (
src/pages/content/) - Script injected into web pages - DevTools (
src/pages/devtools/) - Developer tools panel - Side Panel (
src/pages/panel/) - Side panel (Chrome) - New Tab (
src/pages/newtab/) - Custom new tab page
- Popup/Options Debugging: Right-click extension icon → Inspect popup
- Background Debugging: Extension management page → Inspect → Background page
- Content Script Debugging: Use developer tools in the target webpage
In development mode, code changes will automatically rebuild the extension. For certain changes (like manifest configuration), you may need to manually refresh the extension.
It's recommended to test extension functionality in all target browsers, as different browsers may have variations in API implementation.
- Chrome Extension Development Docs
- Firefox Extension Development Docs
- SolidJS Official Docs
- Vite Official Docs
- Manifest V3 Migration Guide
MIT License - See LICENSE file for details.
🌟 If this template helps you, please give it a Star!