3 ms·
Oh, I see what you mean. The option is surfaced where a page has "enough" text according to Readability's heuristic. Where absent, it wouldn't be able to do any
by throwanem 1y ago
Oh, I see what you mean. The option is surfaced where a page has "enough" text according to Readability's heuristic. Where absent, it wouldn't be able to do anything useful anyway. (It is doing something a lot more sophisticated than just document.write(Array.from(document.querySelectorAll('')).map(({ innerText }) => `<p>${innerText}</p>`).join()).)
I can't really speak to the details of that heuristic this decade, but I believe an early version of Mozilla's reader-mode implementation (maybe also the basis for others) still to be available on Github under the name "Readability.js", which should provide a suitable reference implementation for further review. (This is also why I keep calling it "Readability;" that was the name it wore when we met.) I assume a current version is also available in the Firefox source.
iOS Safari's implementation is always available, even when the "Show Reader" menu option is grayed out, the equivalent of Firefox hiding the button: long-press the "aA" context-menu icon in the URL bar. But if the page can't be rendered usefully in reader mode, all that will happen is the regular haptic to tell you the system recognized your input.