Home

Awesome

Learning Firefox extensions (Firefox add-ons)

Just one of the things I'm learning. https://github.com/hchiam/learning

Tutorial: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Your_first_WebExtension

An example forked from MDN repo: https://github.com/hchiam/webextensions-examples/tree/master/borderify

Some steps:

  1. Open about:debugging in Firefox.
  2. Click "This Firefox" if that option exists.
  3. "Temporary Extensions": "Load Temporary Add-on..."
  4. Select the .json file.
  5. (If you're running Firefox in incognito, go to about:addons -> "Manage" -> "Run in Private Windows": "Allow")

You might need about:debugging to see Extension ID = GUID for browser_specific_settings.gecko.id in manifest.json, or run JavaScript crypto.randomUUID() to generate a most-likely-unique UUID.

Example Firefox add-on repos:

Note:

This template is old – consider using something like https://github.com/GoogleChrome/chrome-extensions-samples/tree/main/functional-samples/tutorial.hello-world or https://github.com/GoogleChrome/chrome-extensions-samples/tree/main/functional-samples

Useful links:

Mobile debugging before deployment:

https://extensionworkshop.com/documentation/develop/getting-started-with-web-ext/

and

https://extensionworkshop.com/documentation/develop/developing-extensions-for-firefox-for-android/

# connect Android mobile device via USB
adb devices
web-ext run --target=firefox-android
web-ext run --target=firefox-android --android-device=...
# a new firefox tab should automatically open

You can now inspect in Firefox with the URL about:debugging on your laptop (e.g. the two I personally found helpful are "Temporary Extensions > Inspect" and "Main Process > Inspect").

Want to create your own Chrome extension?

Used this template repo as a starting point: https://github.com/hchiam/chrome-extension-template