←back to thread

451 points todsacerdoti | 1 comments | | HN request time: 0.211s | source
Show context
sbinnee ◴[] No.45060391[source]
I always knew that there should be a way to have a button to change light and dark mode on my website without javascript. But I couldn’t figure it out (pre llm era) and gave up and just used javascript. Now it’s time to make an update on that. This blog motivated me.
replies(3): >>45060405 #>>45060700 #>>45062138 #
masklinn ◴[] No.45060700[source]
It’s nice but probably not that useful as you still need JS to persist the setting.

For testing there are extensions which allow overriding the browser’s scheme (for Firefox anyway).

replies(2): >>45061637 #>>45067531 #
1. exodust ◴[] No.45061637[source]
> JS to persist the setting.

Yes, local storage is crucial functionality. I don't get people who disable JS, but I suppose if they have a bunch of sites they whitelist it's less painful... but then they must trust those sites all the time? How do they know if those sites haven't installed new scary scripts?

Perhaps one possible solution is for browsers to offer a setting to enable all the "safe" functionality of javascript such as button events for fancy carousels, but block the stuff that causes anxiety. I suppose then we'd all argue about what aspects are safe vs scary.