Browser Extensions, at their best, can be pretty awesome. They can add powerful functionality to web browsers.
In the past if one wanted to support multiple web browsers one had to write multiple extensions. These days things have coalesced towards a single system called WebExtensions.
On this page I hope to collect and simplify what most of us need to know to create a WebExtension.
- The WebExtensions API – A dedicated page looking at aspects of the API used to build browser extensions.
- WebExtension Tooling – A dedicated page covering the various tools available to expedite browser extension development.
- Building WebExtensions with React – The title says it all, a dedicate page on using React to create browser extensions.
- Open Source Browser Extensions – An extensive list of oss browser extensions one can contribute to or learn from.
The Google Angle
Unfortunately, Google is a bit rogue on the WebExtensions front. You’ll need to use Mozilla’s polyfill to ensure the extension works in Chrome without changes. You could design the extension to work with Chrome since Mozilla understands the Chrome API calls. This latter method isn’t ideal from a standardization perspective.
Web Extension Documentation for Specific Browsers
- Google’s Extensions Documentation.
- Opera’s Extensions Documentation.
- Microsoft’s Edge Extensions Documentation.
- Mozilla’s (MDN) Extensions Documentation.
- Mozilla’s Extension Workshop.
- Official W3C Browser Extension Community Group.
- Mozilla’s webextensions-examples – Stars: 2.6k – Updated: 11/2020 – Checked: 1/2021.
- A few of the ones I’m interested in are: annotate-page, bookmark-it, commands (register keyboard shortcuts), context-menu-copy-link-with-types, contextual-identities, export-helpers, favourite-color (uses storage.sync), find-across-tabs, forget-it, google-userinfo (authenticate using google), history-deleter (manipulate browser history), mocha-client-tests (unit testing), permissions (grant/revoke optional permissions), quicknote, user-script-register (integrate with third party scripts).
- Google Chrome’s Official Extension Examples – Stars: 7.4k – Updated: 12/2020 – Checked: 1/2021.
- A few of the ones I’m interested in are: My Bookmarks, History Override, Google Document List Viewer, Managed Bookmarks, Sample – OAuth Contacts, Optional Permissions – New Tab.
- Chrome Extensions Examples – Stars: 1.2k – Updated: 1/2020 – Checked: 1/2021.
- A GitHub repo with the code extensions from Google’s official examples.
- webext-options-sync – Stars: 61 – Updated: 6/2020 – Reviewed: 6/2020
- Allows one to easily set (for options) defaults, add auto-load/save, and sync between browsers.
- TinyWebEx – Stars: 6 – Updated: 2/2020 – Reviewed: 6/2020
- Logging, syncing, localizing, etc. helpers for extensions.
- UI Code for Chrome Extensions – Stars: 99 – Updated: 6/2018 – Reviewed: 6/2020
- For options/settings page.
- Options Page for Chrome Extensions. – Stars: 48 – Updated: 10/2018 – Reviewed: 6/2020
- Aids in creating a options page for an extension.
Starters / Boilerplate
- Web Extension Starter – Stars: 916 – Updated: 11/2020 – Reviewed: 12/2020.*
- Chrome Extension Webpack Boilerplate – Stars: 1.2k – Updated: 11/2019 – Reviewed: 12/2020.
- Offers branches both with and without React.
- EmailThis’ Extension Boilerplate – Stars: 2.6k – Updated: 6/2017 – Reviewed: 12/2020.
- browser-extension-template (notlmn) – Stars: 235 – Updated: 11/2020 – Checked: 12/2020.
- Barebones boilerplate with webpack, options handler and auto-publishing.
- browser-extensions (trigger-corp) – Stars: 315 – Updated: 3/2019 – Checked: 12/2020.
- Build and run cross-platform browser extensions from one codebase.
- James Hibbard. Build a Chrome Extension to Streamline Your Workflow. sitepoint, 4/2020.
- SitePoint uses a browser extension to convert WP posts into markdown. Hibbard explains how to build the basics and there is a link to the github repo where the full extension is available.
- Erika Tan. How to Create a Chrome Extension Part 1. freecodecamp, 2018.
- Jake Prins. How to Create and Publish a Chrome Extension in 20 Minutes. freecodecamp, 2018.
- Fairly basic.
- Ire Aderinokun. Creating the Feature Queries Manager DevTools Extension. smashing magazine, 2018.
- This is a DevTools extension.
- Jennifer Wong. Creating My First Chrome Extension. 24 ways, 2018.
- Good overview.
- Benjamin Young. WebExtensions 101. rollout blog, 2017.
- David Rousset. Creating One Browser Extension For All Browsers… Smashing Magazine, 2017.
- While getting older this is one of the more detailed articles on the topic.
- Evan Sangaline. Breaking out of the WebExtensions sandbox. 9/2018.
- Sarah Drasner. How to Build a Chrome Extension. css-tricks, 5/2020.
- Covers the absolute basics.
- Marouane Rassili. How to Make a Chrome Extension – A Browser Plugin Development Tutorial. freecodecamp, 6/2020.
- Uses Parcel and Tailwind.
- Mozilla’s Discourse Forums on Add-Ons.
- Frederico Brigante’s Awesome List of WebExtensions. – Stars: 589 – Last Updated: 7/2020 – Last Checked: 12/2020.
- Awesome Chrome Extensions – Stars: 183 – Last Updated: 8/2020 – Last Checked: 12/2020.