Please take a look at Bookmarklets Context Menu, a WebExtension that allows to execute bookmarklets as privileged scripts: https://github.com/mems/bookmarklets-context-menu https://addons.mozilla.org/es/firefox/addon/bookmarklets-con... Not sure if it'll work in the mobile version of Firefox though, works great in desktop.
Ask HN: My eyesight is not good enough to read HN. What can I do?
41–50 of 55 posts
Re: Ask HN: My eyesight is not good enough to read HN. What can I do?
#42>> As a programmer I know how bad the app security models are. Don't understand this. What does this mean? And then do you not use any apps at all?
No, I don't use apps. Apps can do millions of things you don't want an untrusted party to do on your device.
Please explain what you’re afraid of.
To me, it sounds like you’re talking about third party apps, and your fear is about third party developers having access to your web accounts. In that case, that makes a bit more sense but then I hope you’re not using any browser extensions as well.
Re: Ask HN: My eyesight is not good enough to read HN. What can I do?
#43If you are using the Opera browser on Android, then when you zoom, the text resizes but then reflows to fit on the screen. I cannot fathom why the other phone browsers do not have this feature, it makes every site readable without any scrolling left or right.
Re: Ask HN: My eyesight is not good enough to read HN. What can I do?
#44Re: Ask HN: My eyesight is not good enough to read HN. What can I do?
#45The existing HN CSP policy allows inline styles. A bookmarklet which just does the following would work: document.querySelectorAll('*').forEach(d => d.style.fontSize='20px') I find it odd that mobile browsers don't allow you to set the font size like desktop browsers do.
Awesome! I was creating a style element and added it to the head. The CSP do not allow that. Now that I know I can alter the elements directly, I will do that instead. Hacker News - I'm back!
Perhaps your problem wasn't with CSP at all, but something else. Maybe a CSS specificity issue?
[edit] - Yeah, I just created this bookmarklet and it worked fine:
javascript:(function(){s=document.createElement('style');s.textContent='*{font-size:20px}';document.head.appendChild(s)})()
Re: Ask HN: My eyesight is not good enough to read HN. What can I do?
#46The existing HN CSP policy allows inline styles. A bookmarklet which just does the following would work: document.querySelectorAll('*').forEach(d => d.style.fontSize='20px') I find it odd that mobile browsers don't allow you to set the font size like desktop browsers do.
Firefox on Android allows scaling according to system font, under Settings > Accessibility. I suppose though that OP is happy with system fonts and not HN fonts.
Re: Ask HN: My eyesight is not good enough to read HN. What can I do?
#47I set the zoom level to 130% in Firefox for this site only. It is persistant. I don't have to do it every time I visit the site. And it doesn't effect other sites.
Re: Ask HN: My eyesight is not good enough to read HN. What can I do?
#48I made one myself for about an hour or two. http://morphical.ml:4000/s/17111778
Re: Ask HN: My eyesight is not good enough to read HN. What can I do?
#49Re: Ask HN: My eyesight is not good enough to read HN. What can I do?
#50Earlier quoted context omitted.
Awesome! I was creating a style element and added it to the head. The CSP do not allow that. Now that I know I can alter the elements directly, I will do that instead. Hacker News - I'm back!
Using a style element should have worked too. The HN CSP policy has unsafe-inline which covers both of these things. Perhaps your problem wasn't with CSP at all, but something else. Maybe a CSS specificity issue? [edit] - Yeah, I just created this bookmarklet and it worked fine: javascript:(function(){s=document.createElement('style');s.textContent='*{font-size:20px}';document.head.appendChild(s)})()
My solution was a link element with a data: URI. Yours is much more elegant. And works!
Thank you very much!