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:
| Browser | How |
|---|---|
| Chrome / Edge / Brave | chrome://extensions/ → Developer mode → Load unpacked |
| Firefox | about:debugging → Load Temporary Add-on |
| Safari | xcrun 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.jsfromlocales/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
| Surface | Where to look |
|---|---|
| Chrome service worker | Extensions page → service worker link |
| Firefox background | about:debugging → Inspect |
| Safari background | Develop menu → Web Extension Background Pages |
| Content scripts | Page 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