A partial archive of discourse.wicg.io as of Saturday February 24, 2024.

JS for text-only browsers

SoniEx2
2018-01-06

There should be a subset of JS for text-only browsers.

jhpratt
2018-01-06

How common are text-only browsers? What’s the use case here?

jschoi
2018-01-07

If you’re talking about displaying web content in a fixed-width character grid, like on a teletype or terminal console…then this is an interest of mine too. I find thinking about text-based browsers useful, when reasoning over progressive enhancement and accessibility technology.

But there’s little in the JavaScript language itself that would prevent using it in a text-based web application. Existing TUI browsers like Lynx could theoretically embed Google V8 and run all the JavaScript it wants. Or someone could create a new TUI web browser using Node.js; they would need to reimplement the DOM and CSS but not JavaScript itself. I vaguely remember that someone wrote a Node.js TUI web browser application, but I cannot find it again now.

A more interesting question might be what to do about the CSS layout and its box model. CSS already supports things like tty media queries…but what about all the existing web content that is not designed for character grids? Should pixels be rounded to the nearest character cell; what about other length units? How should the application deal with poorly accessible websites—should it enable nudging or expanding specific content boxes that could not otherwise be fully read on the TUI? These are all very interesting questions that should, theoretically, be solveable without adding much to the standards. It’s mostly up to the developers here to figure all this out.

It’s a shame that TUI web browsers nowadays support hardly any of the new standards, let alone even CSS text styling, but we can hardly blame them.

TL;DR: There’s probably little to do with the standards yet. It’s up to developers to develop a modern text web browser first, one that can browse the web of today.