🔥 Starter kit for building Chrome/Firefox extensions
- Typescript
- React
- Bootstrap
- CSS Modules
- Live reloading
The extension starter kit uses webextension-polyfill
which allows you to build extensions that automatically work on both Chrome and Firefox!
An example content script is included in src/contentScripts/example.ts
. Webpack outputs processed files as [name].bundle.js
, so in manifest.json
, the content script is loaded as example.bundle.js
.
After loading Extension Starter Kit, visit http://example.com and open the console to see the example content script in action.
- Run
npm run develop
to start webpack-dev-server - Open
chrome://extensions/
and load the extension in thedist-dev
directory
The following parts of the extension will be automatically updated through live reload / hot module replacement:
- Background script
- Extension pages (e.g. options.html)
Content scripts will not be automatically updated (unless loaded into non-SSL pages) and will require a refresh.
- Run
npm run develop-firefox
to start webpack-dev-server - Load
build/manifest.json
atabout:debugging#/runtime/this-firefox
- Bump the version number in
package.json
- Create a git tag called
v${version}
usinggit tag -a v<version>
- Run
npm run build
(Chrome) ornpm run build-firefox
(Firefox) to create a production build inside thedist-prod
directory. - Upload the zip to the Chrome developer dashboard and Firefox addons site
If a copy of the source code is required, run npm run zip-source