== The limitations of Firefox's Reader mode Firefox has had a special [[Reader mode https://support.mozilla.org/en-US/kb/firefox-reader-view-clutter-free-web-pages]] for a long time now. Since I find that many web pages are badly styled in ways that make them hard to read, or at least annoying, [[I resort to it periodically FirefoxReaderModeExperiment]]. However it has a number of limitations that are fundamental to what it does. Put simply, Reader mode hunts through the page to find the important content and present it to you with minimal styling. This opens up a number of limitations: * Reader mode may not be able to analyze the page, even though you can see the content with your eyes. For example, in an amusing irony it currently doesn't seem to be able to generate a Reader view of [[its own Mozilla support page https://support.mozilla.org/en-US/kb/firefox-reader-view-clutter-free-web-pages]]. * Reader's idea of where the page's content ends (or starts) may not match reality, so that it truncates the text before the actual end or skips some of the start, or both. * Reader can omit portions of the content that it thinks are unimportant (or not actually content, as opposed to ads or whatever shoved into the middle). Depending on what you're reading, the omissions may or may not be obvious. * Reader doesn't necessarily render content correctly, depending on how that content is formed into the article. One may reasonably criticize sites like Medium for making it necessary to enable JavaScript and iframes to see things like [[this article https://medium.com/@cep21/using-go-1-10-new-trace-features-to-debug-an-integration-test-1dc39e4e812d]] with all its (necessary) content, but they are what they are, and Reader isn't doing you a service by not showing much of that (for whatever reason). * Reader's content flattening can give you terrible results for certain sorts of content, such as code and output in
blocks. In the case of [[the Medium article https://medium.com/@cep21/using-go-1-10-new-trace-features-to-debug-an-integration-test-1dc39e4e812d]], the code blocks are forced to line-wrap and Reader just won't show them in a single line no matter how wide I make the browser window. (In general Reader seems to not like going very wide, which is another limitation; you're at the mercy of its view of what a 'plain' style means.) An issue that is not a limitation as such is that Reader's styling doesn't necessarily work for all content. Some content simply has been structured in part based on how it looks (and [[this is not wrong SpaceAndContent]]); when Reader comes along and changes that look, the writing may not work as well. In somewhat stronger cases, the original visual appearance is important for understanding the content or having it flow right and of course Reader's rendition will be completely different. (This is where people chime in about sticking to semantic markup. I used to be a fan of the idea, but I've come around to feeling otherwise for various reasons well beyond the scope of this entry (I'm surprised that I haven't already written an entry [[here /blog]] on that, but apparently not).) All of these limitations of Reader mode are why I often resort to what I call 'view page in no style' (View → Page Style → No Style). Turning off all CSS is a blunt hammer and doesn't always work all that well, but it definitely doesn't exclude any content (if anything, it includes too much) and it doesn't mangleblocks of code. In fact I do this so often that I added a [[FireGestures https://addons.mozilla.org/en-US/firefox/addon/firegestures/]] user script to toggle it and bound the script to a simple gesture (I use Right-Left, which is trivial to do rapidly). PS: If you want the JavaScript for said user script, it is: .pn prewrap on > getMarkupDocumentViewer().authorStyleDisabled = !getMarkupDocumentViewer().authorStyleDisabled; This only works in Firefox 56 and before, obviously, since FireGestures itself is not a WebExtensions addon and so doesn't work in Firefox Quantum (57+). Sadly, according to the author of [[Foxy Gestures https://addons.mozilla.org/en-US/firefox/addon/foxy-gestures/]], 'view page in no style' (as a toggle or otherwise) can't be done in Firefox 57+ because WebExtensions have no API for it (see [[my feature request for this https://github.com/marklieberman/foxygestures/issues/212]]). Perhaps Firefox will add a new WebExt API eventually, but I'm not holding my breath. PPS: Toggling Reader mode is available as a WebExtensions API ([[here https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/tabs/toggleReaderMode]]), so you can at least add a gesture for that to [[Foxy Gestures]] if you want. I suspect that the presence of this API means that Mozilla would reject requests for 'view page in no style' on the grounds that the 'right' solution is improving Reader mode.