A template for creating browser extensions using Svelte, TypeScript, and Vite.
# Clone the repository
git clone https://github.com/yourusername/svelte-extension-template.git
cd svelte-extension-template
# Install dependencies
npm install
# Start development server with auto-reload
npm run dev:ext
This will:
For a better development experience with automatic extension reloading:
# For Chromium-based browser (Chrome, Brave, Edge, etc.)
npm run dev:chrome
# For Firefox
npm run dev:firefox
These commands will:
# Build the extension for production
npm run build
The built extension will be in the dist directory.
chrome://extensions/dist directoryabout:debugging#/runtime/this-firefoxmanifest.json file from the dist directoryEdit public/manifest.json to customize your extension's metadata, permissions, and behavior.
Replace the placeholder icons in the public/icons directory with your own.
src/pages/background/index.tssrc/pages/content/index.tssrc/components/Popup.sveltesrc/pages/popup/index.htmlsrc/pages/popup/index.tssrc/components/Options.sveltesrc/pages/options/index.htmlsrc/pages/options/index.tsAll components in this template are optional. The build system automatically detects which components exist and includes only those in the build. To remove a component:
src/pages/.public/manifest.json file.src/components.For example, to remove the options page:
src/pages/options/ directory.options_ui field from the manifest.src/components/Options.svelte.MIT