Before HN added CSP headers, I used a bookmarklet to change the font size. But since the CSP headers were added, FF and Chrome both refuse to execute the bookmarklet.
Some might suggest to use an app instead. But I don't use apps. As a programmer I know how bad the app security models are.
Is there any solution, or am I effectively cut off from HN?
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.
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?
 - Yeah, I just created this bookmarklet and it worked fine:
My solution was a link element with a data: URI. Yours is much more elegant. And works!
Thank you very much!
style-src 'self' 'unsafe-inline'
This means they can include CSS from the same origin, or inline. It would need "data:" adding to the list to allow data URI's as an accepted source.
I suppose though that OP is happy with system fonts and not HN fonts.
Using these settings, HN is a pleasure to read! Other sites suffer, of course, because large fonts destroy their layouts, but those sites are FUBAR (from an accessibility point of view) anyway.
On an iPhone:
1. Hold down the home button to summon Siri.
2. Say "turn on Voiceover."
Now when you touch parts of the screen, that element will be read to you. If you're focused on a button or link, tap twice to activate it. Scroll with a three finger swipe.
Will definitely take some getting used to, but in some ways it's actually superior to sighted reading. No strain or fatigue, you can control your phone without taking it out of your pocket, and you can listen while walking around.
An alternative, and I also do this, is to do this workflow:
1. Get an RSS reader with HN hooked up to it.
2. Read all the article titles and open the ones you think sound interesting in the browser.
3. Use the Pocket for Chrome extension to add those items to the Pocket app. It's Mozilla, it's not particularly evil or leaky.
4. Read the articles on your phone in a readable font You can change the text size in settings.
There are some other alternative workflows for getting text read aloud on the laptop, message me if you're interested.
From a quick search of the App Store, here are two apps that may help – I haven't tried either of them, though:
Font Size App Extension: https://itunes.apple.com/us/app/font-size-app-extension/id10...
Safari Snippets (lets you add custom JS snippets to execute): https://itunes.apple.com/us/app/safari-snippets/id1126048257...
I'm assuming that by "I don't use apps", you just mean you don't want to use a specialized HN reader app. If you don't want to install any apps at all, I guess the above won't help… though you could always write your own app.
edit: The above may be unnecessary if, as mike-cardwell suggested, the issue isn't that the bookmarklet isn't executing, but that it tries to add a style tag and isn't allowed.
HN staff: please consider having a typographer/UI designer make a few improvements to the base stylesheet. I realize the codebase may be old, but it's a paragon of Lisp purity so it should be easy to change, no? ;)
Current example: The Reddit redesign. It's a nightmare.
Changes to HN that would help me are:
Get rid of the CSP headers
Change the output so that the browsers reader mode can understand it.
That being said, in my experience HN is really one of the least problematic sites when it comes to accessibility! It even works fine with CSS off. Kudos to the designers!
I set the hn zoom level to 120%, and firefox remembers my zoom setting for the site so I don't have to set it every time.
Unrelated to reading HN, if LASIK or similar is an option for you I would suggest you to talk to your ophthalmologist. Having eyesight corrected has been one of the best decisions I've made. It had such a drastic impact on my quality of life.
However, LASIK and similar approaches are not without problems when your vision is really bad (10 diopters or more), so I would recommend to inform yourself thoroughly before taking this step!
Don't understand this. What does this mean?
And then do you not use any apps at all?
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.
And yes, I don't use browser extensions either.
Not sure if it'll work in the mobile version of Firefox though, works great in desktop.
It's open source (https://github.com/manmal/hn-android/), works great and it has a bunch of accessibility settings. It's basically a read-only experience, though - no commenting.
See it in action in this screenshot:
(If alternate browsers count as „use an app“ advice, I apologize for my suggestion.)
I made one myself for about an hour or two.
Ironically, setting the "dynamic text size" makes all kinds of text in the OS way too big but lets the text on HN as small as before.
And I don't want to "zoom" because that makes the text overflow the screen on the right.
Or maybe some JS bookmarklet (never tried w/ iOS Safari), personally.
I also thought there was an "Accessibility Zoom" that uses 3-fingers (for all iOS, not specific app)?
Accessibility settings on ipad has some zoom features too.
Or just write a quick scraper.
(User is specifically asking about reading HN on mobile devices, not a desktop OS.)
uBlock Origin, the content blocking extension I'm using on Firefox for Android, can inject css rules as well.