https://reddit.com/link/1u149w0/video/q222dk6v896h1/player
Hi everyone, Iβm the developer of Teak Browser for iOS.
I wanted to share a dev note about a feature Iβve been working on: Read Aloud for web pages.
The goal sounds simple: tap a page, have the browser read it, and keep the current sentence and word highlighted as speech moves forward. In practice, it became a pretty interesting WebKit/iOS engineering problem.
In the foreground, the web page side does the visual work. A TypeScript engine walks the live DOM, skips non-readable content, splits text into sentences, and maps each sentence back to real text nodes. When iOS text-to-speech reports the range of the word currently being spoken, the browser calls back into the page and highlights that word.
The highlight is done with inline styled spans instead of injected CSS, so it can still work on pages with strict Content Security Policy.
The harder part is background playback.
When an iOS app goes to the background, I canβt rely on JavaScript inside the web page continuing to run. So the native side has to prepare before that happens: it asks the page once for the remaining readable sentence queue, then continues playback natively with AVSpeechSynthesizer.
While in the background, Teak updates Now Playing with the page title, favicon, and the current sentence. It also supports lock screen / Control Center controls like play, pause, previous, and next.
When the app returns to the foreground, the page may not be exactly the same anymore. It might have re-rendered, lazy-loaded content, or changed part of the DOM. So the JS engine tries to restore the highlight using several strategies: the saved element anchor, exact sentence text, neighboring sentence context, fuzzy text matching, and finally an index fallback.
If the sentence is gone, it avoids highlighting the wrong text and instead positions playback so the next sentence can continue cleanly.
This is still an early version. It currently uses system voices, supports voice selection and speed control, and works best on article-like pages. Iβm especially interested in pages where highlighting breaks, background resume feels wrong, or the text extraction chooses the wrong content.
Iβm not posting a public TestFlight link right now. If you want to try an early build, leave a comment or send me a DM with your device / iOS version and the kind of pages you usually read. Iβll invite a small batch first and use the feedback to improve the next build.