6

All modern web browsers now have a 'Reader View' mode available. Is it possible, via CSS and/or Javascript, to tell browsers to automatically use the 'Reader View' version on mobile devices that have up to 480px screen width?

I just don't want to create a mobile version of the site since the 'Reader View' version works perfect on mobile devices (that have 320px-480px screen width).

PS. I'm not looking for the information when the Reader View icon is triggered - I want to force the Reader View mode on mobile devices that have less than 480px screen width. Besides, the Reader View mode is available in other browsers too (not only in Firefox).

NonCoder
  • 235
  • 3
  • 10
  • possible duplicate of [How Does Firefox Reader View Operate (FF version 38.0.5)](http://stackoverflow.com/questions/30661650/how-does-firefox-reader-view-operate-ff-version-38-0-5) – TylerH Jul 11 '15 at 03:49
  • Chrome doesn't have Reader View yet; it's only in the Developer version (45). The current stable version is 43. IE11 only supports Reader View in Windows 8.1. So for most people, only Firefox and Safari have it. (PS - triggering a browser to use Reader View requires knowing how it is triggered). – TylerH Jul 11 '15 at 06:51
  • 1
    There is no official spec for Reader View/Mode; each browser implements it completely differently, so it will probably be somewhere between a total nightmare and impossible to implement. Here is Mozilla's implementation: https://github.com/mozilla/readability Here are relevant Chromium Issues: https://code.google.com/p/chromium/issues/list?q=label:Cr-UI-Browser-ReaderMode Unfortunately there is an issue open to disable it on Chrome for "low power" (read: mobile) users: https://code.google.com/p/chromium/issues/detail?id=423902 So this request might ultimately be a pipe dream for Chrome. – TylerH Jul 11 '15 at 07:09

1 Answers1

1

The URL of the Reader mode is: about:reader?url=https%3A%2F%2F.... The url parameter must be URL encoded.

I tried changing the page location to that URL and got an access denied error using Firefox 68.0.1.

I also tried to create a link, it fails without error. Mozilla doesn't seem to be willing to give access to it.

Instead, you can reuse their implementation which uses Readability. To run it only when on mobile you can check those questions:

pyb
  • 3,448
  • 1
  • 22
  • 35