Allow user scripts for the new Firefox Reader facility `about:reader` #2195

Closed
cipriancraciun opened this Issue Jun 6, 2015 · 9 comments

Projects

None yet

3 participants

@cipriancraciun

With the latest edition of Firefox, they have integrated the Pocket "reader", which when activated will load a "reading" version of the original page at an URL like about:reader?....

However user scripts are not allowed for about pages, including the about:reader.

I've made a small hack in modules/util/isGreasemonkeyable.js, by adding a line like the one below just after if (/^about:blank/.test(url)) return true;:

if (/^about:reader(\?.*)?$/.test(url)) return true;
@arantius
Collaborator
arantius commented Jun 6, 2015

I'll bet dollars to donuts that like other about: pages, it has chrome privileges, so it will never be greaseable.

@cipriancraciun

I didn't say (although I wanted to) in my initial comment that I have zero knowledge about what my update implied. Perhaps it just opened a large security whole in my browser, but since I use only user scripts written by me, I am less concerned with potential security issues from my own scripts.

But, indeed a more knowledgeable person, in the inner workings of both Firefox and Grease Monkey, should look into this.

@arantius
Collaborator
arantius commented Jun 6, 2015

What exactly are the steps to launch such an about:reader page? I couldn't figure it out in the ~2 minutes I spent trying.

@cipriancraciun

For example open the following link, and in the address bar, at the right, just before the reload button there is a small button like a book. Just press it.

http://getpocket.com/blog/2015/06/pocket-is-now-built-into-firefox/

(I guess you need the latest Firefox 38.0, and this feature works only on some pages like the one above.)

@arantius
Collaborator
arantius commented Jun 6, 2015

Oh, no about: shows in the UI in that case. But I'm clear what you're talking about and I can check what that context is.

@arantius arantius added this to the 3.4 milestone Jun 6, 2015
@cipriancraciun

Indeed the address bar still shows the original URL, but if you run inside the console document.URL, something like about:reader?... appears.

(I applied the patch described in the first comment and it works.)

@janekptacijarabaci
Contributor

e.g.
about:reader?url=http%3A%2F%2Fgetpocket.com%2Fblog%2F2015%2F06%2Fpocket-is-now-built-into-firefox%2F
about:reader?url=https%3A%2F%2Fsupport.mozilla.org%2Fcs%2Fquestions%2F1063000

@arantius arantius modified the milestone: 3.4, 3.5 Jul 24, 2015
@arantius arantius added a commit that closed this issue Sep 23, 2015
@arantius arantius Allow scripts at `about:reader`.
Fixes #2195
02bd979
@arantius arantius closed this in 02bd979 Sep 23, 2015
@arantius
Collaborator
@cipriancraciun

Perfect. Works like a charm for reader URL's.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment