This is a simple project to give a basic skeleton of a WebExtension that is ready to go for Firefox and Chrome. Other platforms are exceedingly easy to add (details below).
Either download or clone this repo and
cd to it.
This will install around 50MB of webpack and related modules in order to develop.
package.jsonand change the 'TODO' entries, and version number
src/manifest.firefox.jsonand change the 'id'
- Update the icons. (A modified sketch file, originally by Bharani, & Email This is provided in resources)
You are ready to build.
npm run build
Debug (non-minified) builds are available using:
npm run build:debug
npm run watch
Note: It is important that you run
npm run build to generate a final minified version, rather than relying on the last watch output.
Adding New Target Platforms
If you wish to develop for Edge or Opera then:
webpack.config.jsand add an appropriate target.
- If necessary, add a platform specific manifest (like manifest.firefox.json) in
- Go to chrome://extensions/
Load Unpacked Extensionand select the
Note: Chrome will keep this extension loaded after shutting down Chrome.
- Go to about:debugging#addons
- Click 'Load Temporary add-on' and select any file in the 'build/firefox' folder
Note: Firefox will always unload this extension after shutting down Firefox.
Thanks to the inspirational work by Bharani, and his Email This boilerplate. Some of his code has been used (and credited) in this project, but will be morphed and removed over time. The primary differences between the two projects:
- Removal of language support. Ironic, no?.
- Removal of Opera support. It's basically the same as Chrome, but trivial to add back in, if need be.
- Changed grunt to use webpack. This allows the code to better minified & controlled.
- Addition of a jquery-like module (notjquery.js) which allows for most common jquery functions, without the seperate (& large) download. See the source files for a demo.