deniz.in

Markets

Weather

Loading weather

· via dev.to (home feed)

Free browser extension adds dual subtitles to SVT, NRK and DR streaming players

A developer in Sweden has built Nordic Dual Subs, a free browser extension that pairs each original subtitle line from SVT Play, UR, NRK TV and DR TV with a synced translation for language learners.

Free browser extension adds dual subtitles to SVT, NRK and DR streaming players

A developer based in Sweden has released Nordic Dual Subs, a free browser extension that overlays two subtitle lines on the streaming players of the Nordic public broadcasters: the original Swedish, Norwegian or Danish caption alongside a synced translation in the viewer's language. Writing on dev.to, the developer, who is still learning Swedish, says the project filled a personal gap. SVT, UR, NRK and DR offer large free libraries with original-language subtitles on almost every programme, but their players show one track at a time and no translation track exists. Tools like Language Reactor solved this for Netflix and YouTube, but not for the Nordic broadcasters.

How it works

According to the post, the extension supports SVT Play, SVT Barn, UR Play, NRK TV and DR TV. It fetches the same subtitle files — WebVTT and related formats — that each broadcaster's own player loads, parses them in a background worker, and draws an overlay inside the site's player so it also works in fullscreen, while the site's own captions are hidden to avoid overlap. Because all five sites are single-page apps, the extension follows URL changes to work out which programme is playing.

Translations cover 29 languages, including Arabic, Persian, Somali, Tigrinya, Ukrainian and Chinese, with right-to-left scripts supported. Clicking a word pauses the video and shows its meaning and base form — the post's example is 'sprang' resolving to 'springa' — with an English gloss from the open Folkets lexikon dictionary. Words can be saved with their sentence, reviewed with simple spaced repetition, or exported to Anki as CSV, and keyboard shortcuts replay the previous or next line, or repeat a line slowly. For films with subtitles burned into the picture, the extension reads them locally with Tesseract compiled to WebAssembly and then translates them.

A translation cache with no running bill

The most unusual part is the translation pipeline, which the developer wanted to run at no cost. Each browser translates lines through Google's free web endpoint from its own IP address and submits the line-translation pair to a small backend. A line only becomes trusted once installs on two different networks have submitted an identical translation: Google returns the same output for the same input, so independent clients converge, and no single install can inject a bad translation. Trusted lines are then served to everyone, indexed by a hash of the line, which means the backend never discloses subtitle text to anyone who does not already hold it. When Google rate-limits a user, a capped DeepL fallback covers the lines near the playhead.

Free-tier infrastructure

The backend runs on Cloudflare's free tier: one Worker plus a D1 SQLite database holding the shared translation cache, anonymous installs identified by HMAC session tokens, optional Google sign-in for syncing saved words, and Stripe wired up for a possible future paid plan. A GitHub Action checks D1 and Workers usage every morning and emails the developer before anything approaches the daily limits. One lesson from the project: the end-to-end tests had been quietly writing thousands of rows to the production database. They now run against an in-process mock API, with a guard that fails the test if anything tries to reach production.

Three stores, one codebase

The same source builds Chrome/Edge and Firefox packages. The Firefox build swaps the Manifest V3 service worker for background scripts, drops the offscreen API because OCR can run in Firefox's background page, which has a DOM, and declares Firefox's data-collection consent. On Firefox for Android, touch controls replace the keyboard shortcuts. Publishing is automated through each store's API, with one catch: Microsoft only allows an Edge extension to be published by API after its first version has gone out by hand.

Some limits sit outside the extension's control: DR TV only plays for logged-in viewers, and certain programmes are geo-restricted to their home countries. After a first user email reported the extension not working on DR TV, it now explains the reason — a required login or a geo-block — instead of failing silently.

Built with an AI assistant

The developer discloses that the project was built with heavy help from an AI coding assistant, which wrote much of the code and the tests, ran the end-to-end tests against real SVT and NRK programmes, and handled most of the store paperwork. The developer decided what to build, tested it during real viewing sessions, and pushed back when the output was wrong.

Why it matters

Dual subtitles have been a solved problem on Netflix and YouTube for years, while public broadcasters — whose free, captioned libraries are among the best immersion resources for Swedish, Norwegian and Danish — were left out. Nordic Dual Subs closes that gap for the five main Nordic streaming services. Its no-cost translation architecture is the other interesting piece: cross-checking independent clients before trusting their output, and serving cached translations indexed by content hashes so the backend never redistributes subtitle text. The same pattern could travel to other public broadcasters' libraries.

According to the post, the extension is free during its launch period, the dual-subtitle feature will stay free, and no account is needed. The Chrome version is live; the Edge and Firefox builds, including Android, were in store review at the time of writing.

  • #browser-extensions
  • #language-learning
  • #subtitles
  • #cloudflare-workers
  • #webvtt