This template consists of a sample extension and a set of build scripts for cross-browser extensions' development. The project aims at developing extensions for several browsers at once and assumes that you need a build step for your scripts. Though one can use it even targeting one browser or for very simple scripting.
How should I install my extension locally? How to publish my extension? What libraries does this template use and how to configure them? For answers to these questions and many more please see the Useful links section.
Please be aware that this template uses Manifest V2
. Read here and here to make your choices.
https://developer.apple.com/documentation/safariservices/safari_web_extensions
- Hit the Use this template button on the upper right and create your repository.
- Clone newly created repository.
- Install dependencies:
npm i
. - See the Configuration and Development sections.
Rather than steps 1 and 2, you could use:
npx degit serglider/cross-browser-extension <your-project-dir>
In this case, you must initialize Git yourself. If you're using a platform other than Github, this method might be more convenient.
There are two places to adjust the project configuration: config.js file and the webExt
section in package.json. TODO: config props explanation.
- Run
npm start
ornpm run start:reload
. The latter will watch yoursrc
directory and reload your extension on files' change. - Load your extension as unpacked pointing the browser to your
dist
directory.
- Run
npm start
- Run
npm run start:firefox
. This will launch an instance of Firefox with your extension installed and will watch the files in yourdist
directory reloading the extension on files' change.
Run npm run release
. After asking a few questions, this will:
- bump the versions in
package.json
andmanifest.json
- (optionally) commit and push your changes
- build your extension into your
dist
directory - create a ready for web stores submission archive in your
artifacts
directory
https://developer.chrome.com/docs/extensions/
https://docs.microsoft.com/en-us/microsoft-edge/extensions-chromium/
https://dev.opera.com/extensions/
https://extensionworkshop.com/
https://www.extensiontest.com/
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions
https://github.com/mozilla/webextension-polyfill/
https://github.com/mozilla/web-ext
- better README
- handle manifest v3
The MIT License (MIT)
Copyright (c) 2021 Sergey Chernykh