Skip to main content

Extension

The browser extension is plain JavaScript — no bundler, no transpilation. Edit, build, reload, repeat.

Prerequisites

  • Node 22 (the build script uses it to generate translation bundles).
  • Python 3 — only if regenerating icons.
  • macOS with Xcode 13+ — only if building the Safari version.

First build

git clone https://github.com/phonlab-tcd/web_reader_extension.git
cd web_reader_extension
./build.sh

This outputs an unpacked extension for each browser under dist/, plus a packaged zip for each. Load it the usual way:

BrowserHow
Chrome / Edge / Bravechrome://extensions/ → Developer mode → Load unpacked
Firefoxabout:debuggingLoad Temporary Add-on
Safarixcrun safari-web-extension-converter dist/safari/, then build the generated Xcode project

Edit loop

After source edits: re-run ./build.sh and click the extension's reload button.

Firefox has an auto-reload option:

npm install -g web-ext
cd dist/firefox
web-ext run

What build.sh does

Worth knowing, because two things happen that are easy to trip over:

  • It regenerates locales/resources.js from locales/resources.json. Edit the JSON, never the generated JS.
  • It strips the "Add to Your Website" tab out of the packaged help page. That tab documents the remotely-hosted script.js, which Chrome rejects inside a Manifest V3 package even as escaped example text. The tab stays on the hosted help site.

Changing the version number

Don't edit version numbers by hand — the version appears in seven files. Use:

./bump-version.sh 1.2.0

See Production → Extension for when to do this, and DEPLOYING.md in the repository for the plain-language walkthrough.

Debugging

SurfaceWhere to look
Chrome service workerExtensions page → service worker link
Firefox backgroundabout:debuggingInspect
Safari backgroundDevelop menu → Web Extension Background Pages
Content scriptsPage DevTools (F12), filter the console by WebReader

There is no automated test suite. Testing is manual — load the unpacked build and exercise the panel on a real page.

Ready to ship? See Production → Extension.

Last updated 2026-07-22