The problem is simple: I have a physical on-air sign, and I need the browser to tell it when a meeting starts and ends. The solution should work without routing my meeting state through someone else’s server.
The extension is published on the Chrome Web Store and the source is on GitHub. The internals — with an interactive simulator — are written up in how it works. This post is the short version, as of v0.8.3: about 4,500 lines of plain JavaScript, no build step, no dependencies, 118 unit tests. Chrome and Chromium, plus Firefox 140+ from the same source.
What it detects
Tab URLs, and nothing else. There are no content scripts; the extension never reads page contents and never touches audio or video. The permissions are storage, tabs and alarms. Host access (http://*/*, https://*/*) is optional and requested per target origin, only for hosts you actually configure.
Built-in prefixes cover Google Meet (meet.google.com), Teams (teams.microsoft.com) and Zoom (zoom.us, app.zoom.us). Custom services — a self-hosted Jitsi, say — are a name plus a list of prefixes, and are checked before the built-ins. The origin must match exactly before the path is compared, so a look-alike domain doesn’t count.
Two trigger modes: any matching tab (default) is ON while a meeting tab exists in any window; only the active tab is ON only when the focused tab matches. An edge is confirmed after a 400 ms debounce, so a redirect that passes through a meeting URL triggers nothing.
Targets
Listener — one URL called on every change, for your own app or script. With no {tokens} in the URL, the state is appended as query parameters (state, service, url, ts).
Webhook — separate ON and OFF URLs, any method, custom headers, Basic auth, a templated body. Success means the status is in an accepted list (default 200, 202, 204), optionally with a required substring in the response. Templates ship for Tasmota, Shelly, Home Assistant and Ntfy; a phone notification is just the Ntfy webhook.
ON-AIR sign — the ESP32-C6 sign. LAN first: GET http://onair.local/api/set?state=1 with an X-API-Token header, short timeout, no retries. If that fails, the cloud bridge: POST to my own API Gateway + Lambda endpoint with a Bearer token, which updates the sign’s AWS IoT device shadow. Modes are 0 off, 1 on, 2 breathing.
Template variables ({state}, {service}, {url}, {ts}) are escaped for where they land: encodeURIComponent in URLs, so a crafted meeting link can’t inject parameters, and JSON-string escaping in bodies that start with { or [. {url} sends only the origin by default — https://meet.google.com, not the meeting ID.
Staying in sync
Manifest V3 replaced background pages with service workers, and Chrome stops an idle one after about 30 seconds. Firefox has no extension service workers, so the build rewrites the background entry into an event page that Firefox can unload instead. Either way, anything in module scope is gone between events. An early version learned this the hard way: after a worker restart it re-sent the Ntfy “in a meeting” push every few minutes. State now lives in chrome.storage.session, which survives worker restarts and is cleared when the browser closes.
A chrome.alarms heartbeat, onair-reconcile, fires every minute. What it does depends on the target’s reconcile policy:
- single — fire on the edge only. Default for listeners and webhooks; right for notifications.
- verify — read the device’s actual mode (
/api/statuson the LAN, otherwise the cloud shadow) and re-send only if it has drifted. Default for the sign. - always — re-send the current state every minute, for idempotent setters.
Policies are clamped to what each target type supports, so a hand-edited import can’t set verify on an Ntfy hook. Each edge carries an AbortController: a new edge cancels the previous one’s requests and retries, so a slow ON can’t land after a quick OFF. While a browser is OFF, the heartbeat retries only targets whose own OFF failed — otherwise one idle browser would switch the sign off in the middle of a meeting running in another.
Fast network errors retry up to twice with backoff. Timeouts and bad statuses don’t. The per-attempt timeout is 3 s by default, configurable from 1 to 20 s.
Storage and secrets
storage.sync holds the config with credentials blanked. Tokens, passwords, auth-like headers and URLs carrying credentials go to storage.local, which doesn’t sync. Secrets are detected by pattern, and if an older version left one in synced storage, it is moved on load.
Settings export is JSON and redacted unless you tick “Include secrets”. Import lists every host the imported targets would contact before applying anything.
Privacy
No telemetry. Requests go only to the hosts you configure — your own devices, your own cloud endpoint. Meeting IDs stay local by default. The Firefox manifest declares data_collection_permissions: none.
The sign
The physical target for this extension is the On-Air LED sign — an ESP32-C6 that turns those requests into WS2812 LED states. The firmware is covered in part 1 of the firmware series and in how the On-Air sign works; the cloud bridge gets its own post once it’s finished.