Can any Firefox experts help me out with a bookmarklet, please?
A HN comment a while ago reported that you can switch to the 'reader mode' view of a website by prefixing the URL with 'about:reader?url=' - this can be useful for some pages where FF doesn't put the 'reader mode' button in the URL bar.
This seemed like an ideal use for a bookmarklet, so I created one as follows:
Note: You must access about: protocol pages by typing them into the address bar. Attempts to navigate through window.location will throw — Error: Access to 'about:addons' from script denied.
Well, I guess you could probably use document.execCommand to do it, unless that is blocked for JavaScript uri scheme access, or ask for async clipboard access (I wonder what happens if you ask for it from JavaScript uri, should take time to investigate some day)
Also if I put a link into the page with the about:reader uri scheme, it does not work (opens blank page if I open new tab, does not go anywhere if I click on it without opening new tab)
I suppose it might work if I put it into an extension of some sort, if not then I think to make it work on Windows it would be easiest to have an AutoHotkey script that prepended about:reader?url= on the address line and pressed enter for you.
I have as yet to find a worthwhile AutoHotkey competitor on Linux or MacOs.
A HN comment a while ago reported that you can switch to the 'reader mode' view of a website by prefixing the URL with 'about:reader?url=' - this can be useful for some pages where FF doesn't put the 'reader mode' button in the URL bar.
This seemed like an ideal use for a bookmarklet, so I created one as follows:
But, this doesn't work. In the console I get the error:TypeError: Location.href setter: Access to 'about:reader?url=https://www.example.com/' from script denied.
Is there any way to work around this, or do bookmarklets simply not have the permissions to alter the URL like this?