Create a browser extension for Chrome, Firefox and Safari in no time.
WebExtensionTemplate lets you skip the boilerplate and write a Web Extension with TypeScript and Svelte or React.
First, fork this repository. Then, follow the steps below. By the end of this, you should be able to search across the project for REPLACEME and get no results.
Extension/_locales/en/messages.json with an extension name and descriptionExtension/README.md with your app's nameExtension/package.json and update...name with your app's nameauthor with your namelicense with the app's licenseExtension/public/settings.html and update the <title> with your app's name<link> in Extension/settings.html if you don't like the provided CSSExtension/imagestoolbar_Qpx.png where Q is 16, 19, etcExtension/images in 48, 96, 128, 256 and 512-pixel sizes app_icon_Qpx.png , where Q is 48, 96, etcmanifest.json with a Firefox extension id (under gecko > id) in the format [email protected]Do the following steps in Xcode.
Note: “Open the project config” means double-click the app name at the top of the file view in Xcode.
Shared (App)/Models.swift and update APP_NAME with your app's namecom.domain.App-Name AppName (iOS) > Signing & Capabilities and update the bundle id.Extension added onto the end. So if your app bundle ID is com.domain.App-Name, this should be com.domain.App-Name.ExtensionAppName Extension (iOS) > Signing & Capabilities and update the bundle id with the extension bundle idMAC_EXTENSION_BUNDLE_ID in Shared (App)/Models.swift with the extension bundle ID as wellmacOS (App)/AppDelegate.swift with a help documentation linkREPLACEME.entitlements to be Your App Name.entitlements REPLACEME.entitlements with the name of your new entitlements fileiOS (App)/iOS Assets as AppIcon with all the required sizesIcon.png in Shared (App)/ResourcesmacOS (App)/macOS Assets as AppIcon with all the required sizesAll npm commands should be run in Extension. Safari extensions should be built in Xcode.
| Browser | Local | Production |
|---|---|---|
| Chrome | npm run build |
npm run build:chrome |
| Firefox | npm run build |
npm run build:firefox |
| Safari | Product > Build | Product > Archive |
console.log calls are stripped out of prod buildsfirefox that runs dist/background.js as a background script