Building Browser Extensions

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.

Big Topics

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

Example Code

Helper Code

  • 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

Articles

Other Resources