Reader View for Pale Moon

Add-ons for Pale Moon and other applications
General discussion, compatibility, contributed extensions, themes, plugins, and more.

Moderators: FranklinDM, Lootyhoof

User avatar
Isengrim
Board Warrior
Board Warrior
Posts: 1325
Joined: 2015-09-08, 22:54
Location: 127.0.0.1
Contact:

Reader View for Pale Moon

Unread post by Isengrim » 2017-12-05, 02:13

When I migrated from Firefox to Pale Moon, the Reader View feature was one of the things I missed most, and I wasn't really sold on any of the existing options for making a site more readable. So I made my own: an implementation of Firefox Reader View for use as an add-on in the Pale Moon web browser.

This extension adds a button with the Reader Mode icon to the Pale Moon interface. When the add-on detects that a page is compatible with Reader View, the button will enable and the icon will turn blue. Clicking the button will enable Reader View for that page, and the icon will turn purple. Clicking the button again will exit Reader View, and the page will return to normal.

Reader View may also be activated by selecting "Enter Reader View" from the View menu, or by using the keyboard shortcut Ctrl + Alt + R.

Many features in Reader View are identical between Mozilla Firefox and this add-on, such as:

* Parse and render a page cleanly and clutter-free
* Activate with the simple click of a button
* Increase or decrease the line spacing between text
* Increase or decrease the font size
* Choose from light, dark, or sepia color schemes

This add-on comes with a few differences, such as:

* Reading times are based on English only.
* Text to speech/narration is not available.
* Pocket integration is not available.
* Telemetry is not included.

This add-on is available from the Pale Moon add-ons site: https://addons.palemoon.org/addon/readerview/
The source code is available here: https://github.com/ascrod/readerview

Happy reading!
a.k.a. Ascrod
Linux Mint 19.3 Cinnamon (64-bit), Debian Bullseye (64-bit), Windows 7 (64-bit)
"As long as there is someone who will appreciate the work involved in the creation, the effort is time well spent." ~ Tetsuzou Kamadani, Cave Story

User avatar
gracious1
Keeps coming back
Keeps coming back
Posts: 891
Joined: 2016-05-15, 05:00
Location: humid upstate NY

Re: Reader View for Pale Moon

Unread post by gracious1 » 2017-12-05, 02:29

Isengrim wrote:When I migrated from Firefox to Pale Moon, the Reader View feature was one of the things I missed most, and I wasn't really sold on any of the existing options for making a site more readable. So I made my own: an implementation of Firefox Reader View for use as an add-on in the Pale Moon web browser. […]

This add-on is available from the Pale Moon add-ons site: https://addons.palemoon.org/addon/readerview/
The source code is available here: https://github.com/ascrod/readerview

Happy reading!
Wow! Nice! Thanks!
20 July 1969 🌗 Apollo 11 🌓 "One small step for [a] man, one giant leap for mankind." 🚀

User avatar
jars_
Lunatic
Lunatic
Posts: 397
Joined: 2016-12-27, 00:12

Re: Reader View for Pale Moon

Unread post by jars_ » 2017-12-05, 06:28

Thank you! I did not even know about this feature in FF :D Works fine.
but after instal and restart, the extension icon does not appear in panel and console has errors:

Code: Select all

Метка времени: 05.12.2017 8:17:49
Ошибка: TypeError: button is null
Источник: resource://readerview/ReaderParent.jsm
Строка: 109

Метка времени: 05.12.2017 8:17:49
Ошибка: button is null
Источник: resource://readerview/ReaderParent.jsm
Строка: 109
.. when I manually dragged the icon to the panel, everything is fine.

User avatar
Isengrim
Board Warrior
Board Warrior
Posts: 1325
Joined: 2015-09-08, 22:54
Location: 127.0.0.1
Contact:

Re: Reader View for Pale Moon

Unread post by Isengrim » 2017-12-06, 04:04

Thanks for the feedback! I have added these issues to the repo and fixes will be in the next release.
a.k.a. Ascrod
Linux Mint 19.3 Cinnamon (64-bit), Debian Bullseye (64-bit), Windows 7 (64-bit)
"As long as there is someone who will appreciate the work involved in the creation, the effort is time well spent." ~ Tetsuzou Kamadani, Cave Story

User avatar
gracious1
Keeps coming back
Keeps coming back
Posts: 891
Joined: 2016-05-15, 05:00
Location: humid upstate NY

Re: Reader View for Pale Moon

Unread post by gracious1 » 2017-12-06, 04:26

Isengrim wrote:Thanks for the feedback! I have added these issues to the repo and fixes will be in the next release.
Just a couple of questions...

Does this mean that you are going to push the toolbar button to the Navigation Toolbar? Having a button appear in the Customize dialog rather than right on the toolbar is not necessariliy undesired behavior.

I hope that it doesn't mean that it will put into the URL bar itself, as it is with Fx or Basilisk. I like to be able to decide where to put the button.

Lastly, would it be possible to include a menu item under Tools in the Menu Bar? Some of us prefer to use menus over toolbar buttons. :)

Thanks!
20 July 1969 🌗 Apollo 11 🌓 "One small step for [a] man, one giant leap for mankind." 🚀

User avatar
Isengrim
Board Warrior
Board Warrior
Posts: 1325
Joined: 2015-09-08, 22:54
Location: 127.0.0.1
Contact:

Re: Reader View for Pale Moon

Unread post by Isengrim » 2017-12-06, 05:47

gracious1 wrote:Does this mean that you are going to push the toolbar button to the Navigation Toolbar? Having a button appear in the Customize dialog rather than right on the toolbar is not necessariliy undesired behavior.
Most likely, yes. I'd rather have the button show up on the UI and be usable right away than to force the user to hunt for it in the Customize menu. I think it's a slightly more user-friendly approach, and most add-ons seem to do this already.
gracious1 wrote:I hope that it doesn't mean that it will put into the URL bar itself, as it is with Fx or Basilisk. I like to be able to decide where to put the button.
Absolutely not! I also enjoy being able to organize my buttons, and allowing others to do the same. ;)
gracious1 wrote:Lastly, would it be possible to include a menu item under Tools in the Menu Bar? Some of us prefer to use menus over toolbar buttons. :)
I just resolved this issue a little while ago - the code for adding the menu item was missing. It will be located under the View menu, identical to where it is in Firefox/Basilisk. There is also a Ctrl+Alt+R keyboard shortcut, which works in the current version.
a.k.a. Ascrod
Linux Mint 19.3 Cinnamon (64-bit), Debian Bullseye (64-bit), Windows 7 (64-bit)
"As long as there is someone who will appreciate the work involved in the creation, the effort is time well spent." ~ Tetsuzou Kamadani, Cave Story

User avatar
gracious1
Keeps coming back
Keeps coming back
Posts: 891
Joined: 2016-05-15, 05:00
Location: humid upstate NY

Re: Reader View for Pale Moon

Unread post by gracious1 » 2017-12-06, 07:21

gracious1 wrote:…push the toolbar button to the Navigation Toolbar?
Isengrim wrote:Most likely, yes. I think it's a slightly more user-friendly approach…
That depends on the user ;) , but I can see how it would be confusing to those who expect it.
Isengrim wrote: …and most add-ons seem to do this already.
To my consternation. :silent: ;) :mrgreen: Seriously, though, when you do this, could you please do it in such a way that it doesn't force a hidden toolbar to appear? I had a problem with this with another extension. At first, I thought there was bug in the toolbar function, because there had been some issues before of toolbars unhiding themselves, but it turns out that it was the extension forcing the toolbar to unhide. The developer graciously modified his extension to resolve the issues. (Bad pun alert. :shifty:)
Isengrim wrote:{re keeping customizable button}
Thanks! :thumbup:
Isengrim wrote:[Reader command] will be located under the View menu, identical to where it is in Firefox/Basilisk.
Ah, of course, that makes a lot more sense than Tools. Thanks for including this! :thumbup:
Isengrim wrote:There is also a Ctrl+Alt+R keyboard shortcut, which works in the current version.
Hmm... :problem: You may wish read why Moonchild removed the Ctrl+Alt+R shortcut from the Restart command, as that particular combination caused serious problems for some users. (This may warrant at least providing an option to disable it and/or reconfigure it.)
Moreover, it also conflicts with current PM add-ons like Restart Manager and Restart Browser which reinstate the Ctrl+Alt+R shortcut to Restart. (To be fair, Restart Manager will let you modify the hotkey to any letter A-Z, but no numbers or punctuation marks. Restart Browser, however, is not configurable.) Just something to consider.

HTH, and thanks again for making this extension available for PM.
Cheers!
20 July 1969 🌗 Apollo 11 🌓 "One small step for [a] man, one giant leap for mankind." 🚀

User avatar
Isengrim
Board Warrior
Board Warrior
Posts: 1325
Joined: 2015-09-08, 22:54
Location: 127.0.0.1
Contact:

Re: Reader View for Pale Moon

Unread post by Isengrim » 2017-12-06, 23:16

gracious1 wrote:...could you please do it in such a way that it doesn't force a hidden toolbar to appear?
I'll keep that in mind!
gracious1 wrote:Hmm... :problem: You may wish read why Moonchild removed the Ctrl+Alt+R shortcut from the Restart command, as that particular combination caused serious problems for some users. (This may warrant at least providing an option to disable it and/or reconfigure it.)
Moreover, it also conflicts with current PM add-ons like Restart Manager and Restart Browser which reinstate the Ctrl+Alt+R shortcut to Restart. (To be fair, Restart Manager will let you modify the hotkey to any letter A-Z, but no numbers or punctuation marks. Restart Browser, however, is not configurable.) Just something to consider.
I hadn't thought about that, but it's a good point. I might bring this issue up with Mozilla, since that shortcut is what Firefox uses today, and it could potentially affect any of their users (or users of derived browsers) who also use an AltGr keyboard layout.
a.k.a. Ascrod
Linux Mint 19.3 Cinnamon (64-bit), Debian Bullseye (64-bit), Windows 7 (64-bit)
"As long as there is someone who will appreciate the work involved in the creation, the effort is time well spent." ~ Tetsuzou Kamadani, Cave Story

User avatar
LimboSlam
Board Warrior
Board Warrior
Posts: 1029
Joined: 2014-06-09, 04:43
Location: USA

Re: Reader View for Pale Moon

Unread post by LimboSlam » 2017-12-07, 03:47

Actually, I enjoyed Firefox reader view in the url bar. Is it possible to make that option available?

Thanks for this cool add-on, and keep up the good work! :) :thumbup:
With Pale Moon by my side, surfing the web is quite enjoyable and takes my headaches away! :)
God is not punishing you, He is preparing you. Trust His plan, not your pain.#‎TrentShelton #‎RehabTime

User avatar
jars_
Lunatic
Lunatic
Posts: 397
Joined: 2016-12-27, 00:12

Re: Reader View for Pale Moon

Unread post by jars_ » 2017-12-07, 14:37

another issue was found: Reader does not offer an action (the icon is pale and does not respond to a click) if the page was open in the background (middle mouse click) If you refresh the page, then immediately the Reader View is ready. This happens with any site :(
(sorry for my bad english)
Last edited by jars_ on 2017-12-07, 14:51, edited 1 time in total.

f-117
Moonbather
Moonbather
Posts: 70
Joined: 2017-02-04, 20:41

Re: Reader View for Pale Moon

Unread post by f-117 » 2017-12-07, 14:43

LimboSlam wrote:Actually, I enjoyed Firefox reader view in the url bar. Is it possible to make that option available?

Thanks for this cool add-on, and keep up the good work! :) :thumbup:
I agree.

It just takes up less room on the navigation bar (On my PM) by having it on the URL bar, just like it is in FF.

I am trying it now and it works great!

Scott

User avatar
gracious1
Keeps coming back
Keeps coming back
Posts: 891
Joined: 2016-05-15, 05:00
Location: humid upstate NY

Re: Reader View for Pale Moon

Unread post by gracious1 » 2017-12-07, 21:19

But having it on the URL Bar is one reason I installed JustOff's Disable Hello, Pocket & Reader+ extension in Fx. Please keep the button moveable.
20 July 1969 🌗 Apollo 11 🌓 "One small step for [a] man, one giant leap for mankind." 🚀

riiis
Lunatic
Lunatic
Posts: 471
Joined: 2014-05-17, 15:51
Location: USA

Re: Reader View for Pale Moon

Unread post by riiis » 2017-12-07, 21:47

"Reader View for Pale Moon" is awesome. However, I do have a few suggestions.

AFAIK the reader feature currently does not exist in Pale Moon. Nevertheless, reader-related preferences and reader-related localization strings do exist in Pale Moon. Yet, the Reader View extension does not use these Pale Moon preferences or localization.

Following are the preferences from "about:config" relating to the Reader View extension:
extensions.reader.jpg
Following are the browser native preferences from "about:config" relating to reader:
reader.jpg
The names of the Reader View add-on preferences should be changed to the names already in use by the browser. AFAIK, the browser's reader preferences are not currently used. But, if that situation should change, the existence of these conflicting preferences may cause user confusion or display errors. Accordingly, these preferences should be renamed or deleted in "readerview.js", and renamed, deleted, or hard-coded in the files in which these preferences are used.

The "readerMain.xul" file currently defines the shortcut key "Ctrl+Alt+R".

Line 27 of "readerMain.xul" should be changed from:
key="&readerview.toggleReaderMode.key;"
Changed to:
key="V"
The "readerview.dtd" locale file is not needed and should be deleted. The line 4 reference to this DTD file in "readerMain.xul" should also be deleted.

This change in "readerMain.xul" changes the Reader View shortcut from "Ctrl+Alt+R" to "Ctrl+Alt+V". If this change in shortcut is not acceptable, change Line 27 of "readerMain.xul" to key="R" (instead of key="V").

"Ctrl+Alt+V" appears to be in use only by the "Evernote" and "Microsoft Excel" programs. Thus, unlike "Ctrl+Alt+R", this shortcut is unlikely to cause conflicts within Pale Moon.

Reader View has only one locale (en-US). Available locales should be and can be easily expanded to 30 or 50 or more locales.

The "aboutReader.properties" file is already localized in Pale Moon ("chrome://global/locale/aboutReader.properties"). However, the Reader View extension appears to be using a different "aboutReader.properties" file, obtained from a recent version of Firefox, for its one locale. This Firefox locale file contains a few strings, not included in the Pale Moon "aboutReader.properties" file. Accordingly, the Pale Moon "aboutReader.properties" files can not be used to expand localization. Instead, to do so, additional Firefox Language Packs must be downloaded from Mozilla. Fortunately, these files are readily available.

Firefox Language Packs (any version) are available from the Firefox FTP site. Two versions are shown below. Replace "55.0" or "24.0" to obtain a different version. Right-click the Firefox Language Packs you wish to download, then select "Save Link As ..." to begin the download. For convenience, download these Language Packs to a separate folder. Use "Bandizip" to extract all Language Packs together at one time, to separate folders, with just two clicks. Then, copy each Firefox file from "chrome://global/locale/aboutReader.properties" to the appropriate locale folder in Reader View.

http://releases.mozilla.org/pub/mozilla ... win32/xpi/
http://releases.mozilla.org/pub/mozilla ... win32/xpi/

User avatar
back2themoon
Moon Magic practitioner
Moon Magic practitioner
Posts: 2358
Joined: 2012-08-19, 20:32

Re: Reader View for Pale Moon

Unread post by back2themoon » 2017-12-07, 23:32

Thank you Isengrim! :thumbup:

User avatar
LimboSlam
Board Warrior
Board Warrior
Posts: 1029
Joined: 2014-06-09, 04:43
Location: USA

Re: Reader View for Pale Moon

Unread post by LimboSlam » 2017-12-08, 03:22

gracious1 wrote:Please keep the button moveable.
Of course, it should stay moveable. Although, an option to move Reader View into the url bar could also be a choice, if it is feasible? :think:


EDIT: Yes, it seems that it will be possible to add Reader View into the url bar. See here: https://github.com/Ascrod/readerview/issues/16.
With Pale Moon by my side, surfing the web is quite enjoyable and takes my headaches away! :)
God is not punishing you, He is preparing you. Trust His plan, not your pain.#‎TrentShelton #‎RehabTime

User avatar
Isengrim
Board Warrior
Board Warrior
Posts: 1325
Joined: 2015-09-08, 22:54
Location: 127.0.0.1
Contact:

Re: Reader View for Pale Moon

Unread post by Isengrim » 2017-12-08, 05:00

If I include an option to put the button in the URL bar, it will be just that - an option. :) I added an issue for it on the repo, but it's more as a reminder for myself to look into it. I haven't delved into whether it is actually possible just yet.

Riiis: I'll try to respond to your post one item at a time.
riiis wrote:AFAIK the reader feature currently does not exist in Pale Moon. Nevertheless, reader-related preferences and reader-related localization strings do exist in Pale Moon. Yet, the Reader View extension does not use these Pale Moon preferences or localization.
I made my own set of resources to intentionally avoid stepping on anything done by the browser, and because much of what's left of the Reader code is pretty outdated. I've been meaning to ask the dev team about what they're going to do with it, but my assumption is that it's targeted for removal as part of code cleanup. Additionally, in regards to naming preferences, I understand that it is good practice for extensions to prefix any custom prefs with "extensions", so that is what I did.
riiis wrote:The "readerview.dtd" locale file is not needed and should be deleted. The line 4 reference to this DTD file in "readerMain.xul" should also be deleted.
Initially, I had assumed that Mozilla defined the key in a DTD file for localization reasons, so I left it there in my project as well. Upon further research, there's a nice big note at the top of browser.dtd that I miraculously seemed to have missed:

Code: Select all

<!-- LOCALIZATION NOTE : FILE Do not translate commandkeys -->
So I'll remove that and hardcode the R in the xul.
riiis wrote:"Ctrl+Alt+V" appears to be in use only by the "Evernote" and "Microsoft Excel" programs. Thus, unlike "Ctrl+Alt+R", this shortcut is unlikely to cause conflicts within Pale Moon.
As discussed above, Ctrl+Alt+R is used here to maintain parity with Firefox/Basilisk. Also as discussed above, Pale Moon no longer uses Ctrl+Alt+R. I am considering adding a "disable_shortcut_key" pref as a workaround for users who might find this key problematic. As to changing the key combo, there was a lot of discussion on Mozilla's end about what to use, and I'd rather stick with what is there now rather than open that debate back up unless Pale Moon reimplements the "Ctrl+Alt+R" shortcut. At best, I will probably make it a configurable option if I can.
riiis wrote:Reader View has only one locale (en-US). Available locales should be and can be easily expanded to 30 or 50 or more locales.
Doing a little more research, it might be easier on me to clone l10n-central from mozilla and cobble together a script that will update the locales in my add-on from that. I need to do the same for Readability.js anyway.

Thank you for the tips!
a.k.a. Ascrod
Linux Mint 19.3 Cinnamon (64-bit), Debian Bullseye (64-bit), Windows 7 (64-bit)
"As long as there is someone who will appreciate the work involved in the creation, the effort is time well spent." ~ Tetsuzou Kamadani, Cave Story

User avatar
Isengrim
Board Warrior
Board Warrior
Posts: 1325
Joined: 2015-09-08, 22:54
Location: 127.0.0.1
Contact:

Re: Reader View for Pale Moon

Unread post by Isengrim » 2017-12-08, 05:02

Reader View 1.0.1 is now up. The Pale Moon addons page and the github repository have both been updated. Please see the release notes for details.

Thank you all for your support, and happy reading!
a.k.a. Ascrod
Linux Mint 19.3 Cinnamon (64-bit), Debian Bullseye (64-bit), Windows 7 (64-bit)
"As long as there is someone who will appreciate the work involved in the creation, the effort is time well spent." ~ Tetsuzou Kamadani, Cave Story

User avatar
gracious1
Keeps coming back
Keeps coming back
Posts: 891
Joined: 2016-05-15, 05:00
Location: humid upstate NY

Re: Reader View for Pale Moon

Unread post by gracious1 » 2017-12-08, 05:27

Isengrim wrote:Reader View 1.0.1 is now up. The Pale Moon addons page and the github repository have both been updated. Please see the release notes for details.

Thank you all for your support, and happy reading!
I appreciate the efforts you made, but I got a serious problem when I installed Reader View 1.0.1 in PM 27.7.0a2 (64-bit) (2017-11-23) on Ubuntu 14.04 .

I had a Custom Toolbar, and it completely deleted it. All the buttons that were on it are back in the Customize dialog box. :( :thumbdown: :cry: It also caused Persona Switcher to change to a different persona, though this is minor in comparison to losing an entire toolbar.

So, just to be safe, I am removing it, and using Clean Uninstall to erase preferences, and then I will install the previous version until this can be fixed.

P.S. I also want to add that I find the button very hard to see. Is there anyway to make more visible?
20 July 1969 🌗 Apollo 11 🌓 "One small step for [a] man, one giant leap for mankind." 🚀

User avatar
Isengrim
Board Warrior
Board Warrior
Posts: 1325
Joined: 2015-09-08, 22:54
Location: 127.0.0.1
Contact:

Re: Reader View for Pale Moon

Unread post by Isengrim » 2017-12-08, 06:18

gracious1 wrote:I appreciate the efforts you made, but I got a serious problem when I installed Reader View 1.0.1 in PM 27.7.0a2 (64-bit) (2017-11-23) on Ubuntu 14.04 .

I had a Custom Toolbar, and it completely deleted it. All the buttons that were on it are back in the Customize dialog box. :( :thumbdown: :cry: It also caused Persona Switcher to change to a different persona, though this is minor in comparison to losing an entire toolbar.

So, just to be safe, I am removing it, and using Clean Uninstall to erase preferences, and then I will install the previous version until this can be fixed.

P.S. I also want to add that I find the button very hard to see.
I am terribly sorry about that! I will take another look at the code that adds the button on first run. Since it only runs once after you install it (and doesn't run again until you uninstall and reinstall, due to permanently setting the first_run pref), it would not have happened again.

Still, this needs to be fixed. I'll do what I can to get this resolved as quickly as possible. Thanks for letting me know.
a.k.a. Ascrod
Linux Mint 19.3 Cinnamon (64-bit), Debian Bullseye (64-bit), Windows 7 (64-bit)
"As long as there is someone who will appreciate the work involved in the creation, the effort is time well spent." ~ Tetsuzou Kamadani, Cave Story

User avatar
SpockFan02
Astronaut
Astronaut
Posts: 535
Joined: 2017-09-24, 16:35
Location: Mak pupulusšum, California

Re: Reader View for Pale Moon

Unread post by SpockFan02 » 2017-12-08, 06:25

gracious1 wrote:I got a serious problem when I installed Reader View 1.0.1 in PM 27.7.0a2 (64-bit) (2017-11-23) on Ubuntu 14.04 .

I had a Custom Toolbar, and it completely deleted it. All the buttons that were on it are back in the Customize dialog box. :( :thumbdown: :cry: It also caused Persona Switcher to change to a different persona, though this is minor in comparison to losing an entire toolbar.

So, just to be safe, I am removing it, and using Clean Uninstall to erase preferences, and then I will install the previous version until this can be fixed.

P.S. I also want to add that I find the button very hard to see. Is there anyway to make more visible?
Huh, I just installed this add-on to try it out, and all but one of the add-on buttons in my navigation toolbar disappeared (plus two buttons that are there by default and I had removed are back). I guess this is why. It's not a big problem for me, since it wasn't a custom toolbar and nothing's deleted. But, yeah, hopefully Isengrim can fix this.

Locked