Ask HN: Browser-extension creators, how do you write for multiple browsers?

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • webextension-polyfill

    A lightweight polyfill library for Promise-based WebExtension APIs in Chrome

  • I used WebExtension polyfill[0] when adapting my FF addon to Chrome and admittedly all the intricate differences between APIs still costed me half a day of work.

    I managed to have it done with only a few places where I branch on navigator.vendor, but If I wanted to ship different versions to AMO and CWS, I'd make use of something like DefinePlugin[1] for webpack to include/exclude code based on build target.

    [0] https://github.com/mozilla/webextension-polyfill/

    [1] https://github.com/webpack/docs/wiki/list-of-plugins#definep...

  • docs

    Discontinued [OLD] documentation for webpack (by webpack)

  • I used WebExtension polyfill[0] when adapting my FF addon to Chrome and admittedly all the intricate differences between APIs still costed me half a day of work.

    I managed to have it done with only a few places where I branch on navigator.vendor, but If I wanted to ship different versions to AMO and CWS, I'd make use of something like DefinePlugin[1] for webpack to include/exclude code based on build target.

    [0] https://github.com/mozilla/webextension-polyfill/

    [1] https://github.com/webpack/docs/wiki/list-of-plugins#definep...

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

    SurveyJS logo
  • Ka-Block

    A Safari extension that blocks an artisanal selection of advertising domains.

  • > Chrome without uBlock (or any browser really) is unusable.

    I use a recent version of Safari and uBlock origin doesn't work there.

    Instead I use Ka-Block![1], which blocks popular ad serving domains. For other annoyances like newsletter popups, etc., I rely on the "Kill sticky headers" script[2], with some custom hacks; I'll try to post my version of that script sometime soon.

    It works good enough for my needs. I also have Firefox with uBlock installed, I end up still using Safari.

    [1]: http://kablock.com , https://github.com/dgraham/Ka-Block

    [2]: https://alisdair.mcdiarmid.org/kill-sticky-headers/

  • ExtPay

    The JavaScript library for ExtensionPay.com — payments for your browser extensions, no server needed.

  • I made ExtensionPay[1] (a service to help you take payments in extensions) and I used Mozilla's `browser` shim in the extension library itself. MV3 is not available on Firefox yet so I support both MV2 and MV3, but yeah it's a pain in the butt to have one MV2 version and one MV3 version.

    [1] https://extensionpay.com

  • spader

    WebExtension maker's toolkit.

  • For our browser extension, The Camelizer, I wrote Spader: https://github.com/cosmic-shovel/spader

    It lets me use Ruby in my html/css/js files, and also sass in the css, letting use use one codebase for all target browsers.

    Definitely a work in progress, and lacks the exciting auto-reload functionality of other similar projects, but it works for us. Issuing one build command and having an extension for all our target browsers is pretty nice.

  • webextensions-examples

    Example Firefox add-ons created using the WebExtensions API

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts