▶ QUEST IN PROGRESS

Flash

A PDF reader that shows you one word at a time, each word positioned so the bit your eye actually locks onto sits in the same spot every time. No eye movement, no backtracking.

2026 – Present
PWA Chrome Extension JavaScript Reading Tools

How I made it

The reading part was the easy bit. Getting readable prose out of a PDF was most of the work. Here’s the whole thing start to finish, in the order I actually did it.

  1. What I wanted

    I wanted to read papers without my eyes moving across the page. That’s what RSVP does – rapid serial visual presentation. You flash one word at a time in a fixed spot, and because your eye never has to travel or jump back, you can go a lot faster than you can reading normally.

    The detail that makes it work is where you put the word. Every word has an optimal recognition point, which isn’t the middle – it’s slightly left of it. So each word gets positioned so that point lands in the same place on screen every single time. Your eye just sits there.

  2. One codebase, two ways to run it

    I wanted it on my laptop and my phone, and I also wanted it to grab PDFs I was already looking at in the browser. So it’s one reader with two wrappers around it.

    The app is a static PWA, installable on macOS and Android. The extension wraps the exact same reader and adds “Read with Flash” to PDF pages, PDF links, and selected text. build.sh just copies the app into the extension folder, so there’s only ever one reader to maintain.

    No build step, no framework, plain files with relative paths. It’ll run from any static host, or from a subdirectory, and I don’t have to think about it.

  3. Getting readable text out of a PDF

    This is the part that turned out to be most of the project. A PDF doesn’t store paragraphs – it stores positioned glyph runs. It knows there’s an “e” at these coordinates in this font. It has no idea what a sentence is.

    So everything a reader needs has to be reconstructed. I group glyph runs into lines by their baseline, and only insert a space where there’s a real gap rather than at every run boundary. Then I rebuild paragraphs using margins relative to the block being built, so an indented abstract or a block quote doesn’t get shredded into a pile of one-line fragments.

  4. All the things that break it

    Then it’s a long list of things that are obvious to a human reader and completely invisible to the parser.

    Two-column layouts need detecting and draining one column at a time in reading order, with full-width lines splitting the page into bands. Words hyphenated across a line break need rejoining. Running heads, page numbers and rotated watermarks all need dropping. A paragraph that continues across a page break needs carrying over.

    And front matter has to go – the author list, affiliations, emails, and the footnotes wedged between the title and the abstract.

    My favourite one: inline citation markers get stripped out of prose. Every [13] costs you a full beat and carries nothing. But [sic] and other worded brackets get left alone, because those actually mean something.

  5. Finding the headings

    Headings are shown whole, as a centred card, instead of being flashed word by word – and the current section stays on screen above the reader so you always know where you are.

    Finding them takes two signals, not one. Type size is the obvious one, but subsections are usually set at body size, so something like 3.2.1 Scaled Dot-Product Attention is only findable from its number. That number is doing double duty: it tells you it’s a heading, and its depth gives you the nesting level for the contents panel.

    Then I had to demote the false headings – banners set in big type, figure labels that repeat on every page, and anything that reads like a wrapped line of prose.

  6. Playing it back

    Playback runs on requestAnimationFrame rather than setTimeout, and that’s not a style preference. A backgrounded or occluded tab clamps timers to roughly one second, which would drag every single word out to the same crawl no matter what speed you’d set.

    Controls are all one-handed: space to play or pause, arrows for one word, J and K for a whole sentence, up and down for speed. Settings cover words per flash, typeface, word size, how long to hold on punctuation, whether to skip the non-prose, and whether to rewind a little when you resume. Position saves per document on its own.

  7. Checking I hadn’t broken it

    Every one of those extraction rules is a heuristic, and every one of them was wrong on some real paper before it was right. So fixing one thing quietly breaking another is the main risk in the whole project.

    tools/check-extraction.sh downloads eight papers that between them cover single-column, two-column, small-type abstracts, appendices sitting after the references, and a table of contents. Then it installs an audit harness I run from the console.

    It reports headings found per level, the share of blocks skipped, and the number that actually matters – droppedProse, the count of prose-shaped blocks the filters threw away. That should only ever be captions and footnotes. Anything else is a regression.

    There’s an EXTRACTOR_VERSION in extract.js that gets bumped whenever extraction changes, so anything imported under an older version gets rebuilt instead of keeping stale text. Your reading position carries across.

  8. Getting it onto my devices

    It has to be served over HTTPS for offline support and installing to work. Localhost is exempt for testing, but I deliberately skip the service worker there so I’m not fighting a stale cache every time I edit something.

    On macOS it installs from the address bar and registers as a PDF file handler, so “Open with Flash” shows up in Finder. On Android it installs from the Chrome menu and then appears in the share sheet, so I can send it a PDF from anywhere.

    Everything runs locally in the browser. PDFs are parsed on-device and stored in IndexedDB, and nothing is uploaded.