Modern Chrome and Firefox Web Extension Example to set and remember your favorite color.
All Chromium Based Browsers can install the extension from the Chrome Web Store.
- Set and Display your Favorite Color
- Set Selected Text to Favorite Color
You can pin the Addon by clicking the Puzzle Piece, find the Web Extension icon, then;
Firefox, click the Settings Wheel and Pin to Toolbar.
Chrome, click the Pin icon.
To open the options, click on the icon (from above) then click Open Options.
Quick Start
To install and run chrome or firefox with web-ext.
npm isntall
npm run chrome
npm run firefoxTo Load Unpacked/Temporary Add-on make a manifest.json and run from the src folder.
npm run manifest:chrome
npm run manifest:firefoxFor more information on web-ext, read this documentation.
To pass additional arguments to an npm run command, use --.
Example: npm run chrome -- --chromium-binary=...
Install the requirements and copy libraries into the src/dist directory by running npm install.
See gulpfile.js for more information on postinstall.
npm installTo load unpacked or temporary addon from the src folder, you must generate the src/manifest.json for the desired browser.
npm run manifest:chrome
npm run manifest:firefoxIf you would like to create a .zip archive of the src directory for the desired browser.
npm run build
npm run build:chrome
npm run build:firefoxFor more information on building, see the scripts in the package.json file.
- Build or Download a Release.
- Unzip the archive, place the folder where it must remain and note its location for later.
- Open Chrome, click the
3 dotsin the top right, clickExtensions, clickManage Extensions. - In the top right, click
Developer Modethen on the top left clickLoad unpacked. - Navigate to the folder you extracted in step #3 then click
Select Folder.
Note: Firefox Temporary addon's will not remain after restarting Firefox, therefore;
it is very useful to keep addon storage after uninstall/restart with keepStorageOnUninstall.
- Build or Download a Release.
- Unzip the archive, place the folder where it must remain and note its location for later.
- Go to
about:debugging#/runtime/this-firefoxand clickLoad Temporary Add-on... - Navigate to the folder you extracted earlier, select
manifest.jsonthen clickSelect File. - Open
about:configsearch forextensions.webextensions.keepStorageOnUninstalland set totrue.
If you need to test a restart, you must pack the addon. This only works in ESR, Development, or Nightly.
- Run
npm run build:firefoxthen useweb-ext-artifacts/{name}-firefox-{version}.zip. - Open
about:configsearch forxpinstall.signatures.requiredand set tofalse. - Open
about:addonsand drag the zip file to the page or choose Install from File from the Settings wheel.