No description
  • TypeScript 98.9%
  • CSS 0.9%
  • JavaScript 0.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-09-25 15:03:57 +02:00
scripts Initial commit 2026-09-25 15:01:56 +02:00
src Initial commit 2026-09-25 15:01:56 +02:00
.gitignore Initial commit 2026-09-25 15:01:56 +02:00
.gitlab-ci.yml Initial commit 2026-09-25 15:01:56 +02:00
babel.config.js Initial commit 2026-09-25 15:01:56 +02:00
biome.json Initial commit 2026-09-25 15:01:56 +02:00
bun.lock Initial commit 2026-09-25 15:01:56 +02:00
LICENSE Initial commit 2026-09-25 15:01:56 +02:00
package.json Initial commit 2026-09-25 15:01:56 +02:00
postcss.config.js Initial commit 2026-09-25 15:01:56 +02:00
README.md fix: readme 2026-09-25 15:03:57 +02:00
tsconfig.json Initial commit 2026-09-25 15:01:56 +02:00
webpack.config.ts Initial commit 2026-09-25 15:01:56 +02:00

wtchd Scrobbler

A Manifest V3 browser extension that sends playback progress from supported streaming services to a wtchd instance. It supports Chrome and Firefox, keeps configuration in the browser's local storage, and uses OAuth so the extension never needs your wtchd password.

Features

  • Detects playback state and reports play, pause, progress, and stop events.
  • Supports movies and series, with service-specific parsers where a generic parser is not sufficient.
  • Lets you enable only the streaming services you use; host permissions are requested only for enabled services.
  • Supports a custom wtchd server and, when needed, a separate API URL.
  • Includes a popup with current playback state, item correction, settings, and a redacted diagnostic log viewer.
  • Builds a separate bundle for each service to avoid shipping one service's private implementation in every content script.

Supported services

The current service list lives in src/models/serviceData.ts. The extension currently includes:

Service Website
Amazon Prime Video primevideo.com
AMC+ amcplus.com
Crunchyroll crunchyroll.com
discovery+ discoveryplus.com
Disney+ disneyplus.com
Go3 go3.lv
GoPlay BE goplay.be
HBO Go hbogo.eu
HBO Max hbomax.com
Hotstar hotstar.com
Kijk.nl kijk.nl
Kino.pub kino.pub
MUBI mubi.com
Netflix netflix.com
NRK nrk.no
Player.pl player.pl
Polsatboxgo.pl polsatboxgo.pl
SkyShowtime skyshowtime.com
Star+ starplus.com
Streamz BE streamz.be
Stremio stremio.com
Tet TV+ tet.plus
TV 2 Play tv2.no
Viaplay viaplay.com
Vidio vidio.com
VRT Max BE vrt.be/vrtmax
VTMGo BE vtm.be/vtmgo
Wakanim.tv wakanim.tv

Requirements

  • Bun 1.3 or newer.
  • Node.js 22 or newer when following the GitLab CI environment.
  • Chrome 111 or newer, or Firefox 140+ on desktop / 142+ on Android.

The extension can be pointed at a self-hosted wtchd instance. You need an OAuth client ID created in that instance's developer settings.

Quick start

bun install --frozen-lockfile
bun run build-dev

The development build is written to build/output/.

Chrome / Chromium

  1. Open chrome://extensions.
  2. Enable Developer mode.
  3. Choose Load unpacked and select build/output/.
  4. Open the extension options and configure wtchd.

Firefox

  1. Run the Firefox development build:

    bun run build-dev-firefox
    
  2. Open about:debugging#/runtime/this-firefox.

  3. Choose Load Temporary Add-on.

  4. Select build/output/manifest.json.

Firefox uses a browser-specific background manifest; Chrome uses a service worker manifest. Keep separate build directories when comparing the two, or rerun the appropriate development command before reloading the extension.

Configuration

Open the extension's Options page:

  1. Set the wtchd server URL. The default is https://wtchd.app.
  2. Optionally set a separate API URL. If left empty, the extension uses <server URL>/api.
  3. Create an OAuth application in wtchd and add the redirect URI shown in the options page.
  4. Paste the OAuth client ID and save.
  5. Choose Connect and approve access.
  6. Enable the streaming services you want to monitor.
  7. Optionally enable notifications and grant the notification permission.

The redirect URI is browser-generated. Use the exact value shown in the options page when registering the OAuth application.

Development commands

Command Purpose
bun install --frozen-lockfile Install the locked dependencies.
bun run check Run TypeScript, Biome, and service-data validation.
bun run test Run the service-data validation script.
bun run tsc Run the TypeScript compiler without emitting files.
bun run build-dev Create a Chrome development build in build/output/.
bun run build-dev-firefox Create a Firefox development build in build/output/.
bun run start Rebuild the development bundle in watch mode.
bun run build Create a Chrome production build and dist/wtchd-scrobbler.zip.
bun run build-firefox Create a Firefox production build and dist/wtchd-scrobbler.zip.

| bun run fix | Apply Biome's safe fixes and formatting. |

Generated build/, dist/, and node_modules/ directories are ignored by Git.

Architecture

  • src/modules/background/ owns the background service worker, message handlers, dynamic content-script registration, notifications, and requests.
  • src/modules/content/service/ contains the shared content-script entry point. Webpack creates one bundle per service from the declarative service configuration.
  • src/models/serviceData.ts is the central registry of service IDs, host patterns, URL matching, and optional DOM parsing rules.
  • src/common/ contains the parser, playback controller, storage, messaging, request, logging, and browser integration layers.
  • src/apis/ contains wtchd authentication, search, and scrobbling clients.
  • src/modules/popup/ and src/modules/options/ are the SolidJS extension interfaces.
  • src/services/ contains service-specific API and parser implementations.

The shared parser first tries the HTML video element, then an injected page function, then declarative DOM parsing, and finally service-specific logic. This keeps common playback handling in one place while allowing services with different page structures to override only what they need.

Permissions and data handling

The manifest requests the following baseline permissions:

  • identity for the OAuth redirect flow.
  • scripting and storage for service detection, playback state, settings, and local logs.
  • unlimitedStorage for corrections and diagnostic history.

Notifications and streaming-site host access are optional. The extension asks for host access when a service is enabled and sends playback metadata only to the wtchd server you configure. Access and refresh tokens, settings, item corrections, and a bounded diagnostic log are stored in browser local storage. Tokens and other known secret fields are redacted from log details; logs should still be treated as diagnostic data when sharing a bug report.

Releases

GitLab CI builds release packages from semver tags such as v1.2.3 or 1.2.3. The pipeline:

  1. Runs checks and a development build.
  2. Builds Chrome and Firefox packages with the tag's version.
  3. Uploads the packages to the GitLab package registry.
  4. Creates a GitLab release.
  5. Publishes to the Chrome Web Store and addons.mozilla.org through manual jobs.

Store credentials must be configured as masked, protected CI/CD variables. The release jobs are intentionally manual because store submissions are difficult to undo.

Troubleshooting

  • A service is not detected: enable it in Options, allow its host permission, reload the service tab, and check the Logs tab.
  • The extension is not connected: verify the server URL, API URL, OAuth client ID, and the exact redirect URI registered in wtchd.
  • A development build is not visible: reload the extension from the browser's extensions page after rebuilding.
  • Firefox rejects the build: make sure you loaded the Firefox manifest; Chrome and Firefox use different background declarations.
  • A service stopped working after a site redesign: inspect the service's parser and serviceData entry, then add or update a fixture for the new markup.

Contributing

Keep changes focused and run bun run check before opening a merge request. New service support should include:

  • A unique service ID and host patterns in src/models/serviceData.ts.
  • A parser or API module when the declarative parser is insufficient.
  • Tests or reproducible fixtures for URL and title parsing.
  • Any required permission or privacy explanation in this README.