A simple TypeScript React starter for creating web extensions for Chrome and Firefox
The starter uses
react
for the popupstyled-components
for styling the popupweb-ext
for installing and hot-reloading the installed extensionwebextension-polyfill-ts
to polyfill the differences of Chrome and Firefoxjest
andtesting-library-react
for testseslint
configured for TypeScriptwebpack
to build the extension
To be able to run the extension you need
- Node.js version 14.x or higher
- Yarn version 1.x
yarn install
installs the required dependencies.yarn watch
starts the dev webpack process, that will watch the TypeScript source code and compile it to./dist/js
on each new file save.yarn extension
starts development of the extension locally on your default browser. This uses web-ext and installs the extension in development mode on the browser.web-ext
watches the output folder (./dist/js) of the webpack process and automatically reloads everytime there is an update to the compiled output.- To start one of the browsers individually run
yarn chrome
for Chromeyarn firefox
for Firefox
The browser instances are started with new profile and settings that are stored in .chrome
and .firefox
folders. This enables to make changes to the browser settings that are persisted in those folders.
To build a production version of the source code, run yarn build
. This will output the code into ./dist/js
To run unit tests locally run yarn test
To run the linter run yarn lint