4 ms·
Ironic that the text is too small to read on my phone, and reader mode is not enabled. Do you have to do something specific to enable, or disable, reader mode?
by a3n 6y ago
Ironic that the text is too small to read on my phone, and reader mode is not enabled. Do you have to do something specific to enable, or disable, reader mode?
- throwanem 6y agoYou actually can't; it is purely heuristic, and (afaik intentionally) has no API facing page scripts or content. It just examines page content and, if it finds "enough" text, offers reader mode. Here's how Firefox's reader mode implementation does it: https://github.com/mozilla/readability/blob/master/Readability-readerable.js#L46 https://github.com/mozilla/readability/blob/master/Readabili...
- vinceguidry 6y agoOh jeez no wonder an extension to default to reader mode hasn't been the panacea I'd been hoping. The stupid extension doesn't have a bar icon to let me turn it off, instead I have to add to a whitelist. Back to the drawing board.
- throwanem 6y agoYou could probably do worse than to build your own extension that just wraps readability.js - the API isn't complicated, it just takes a document object and gives back an element tree you can use to replace the page body content. That'd let you control when and how it gets used, and also tune the heuristics to taste, neither of which is really available even to extensions with the browser's built-in reader mode. It feels pretty gross to duplicate native functionality, sure. But it probably beats waiting for browsers to start exposing those APIs; they don't do that for a reason, and that reason seems unlikely to change very soon.
- eyelidlessness 6y agoI recently tried to overcome some unexpected reader mode behavior on my site, and found it very difficult to find good, consistent, thorough documentation. It’s pretty opaque and can change without warning, and unlike most browser technology intentionally so (because documenting it makes it easy for ads and other junk to cheat). That said, I found one article[1] much more helpful than most of the other resources I found, linking here so it might help others. 1: https://medium.com/@mandy.michael/building-websites-for-safari-reader-mode-and-other-reading-apps-1562913c86c9 https://medium.com/@mandy.michael/building-websites-for-safa...