Dark Mode for Hacker News #

is requested regularly:

and while @dang expressed a willingness to implement it back in 2020, support is still absent as of early 2023 (in his defense, he did mention: "remember our motto: move slowly and preserve things...When I say slowly I mean slowly.").

Browser extensions like Dark Reader or Cascadea (among many others that support userscripts for customizing webpages) are often recommended as an alternative by those who are unaware of or indifferent to the risk:

Webpage Contents: Can read sensitive information from webpages, including passwords, phone numbers, and credit cards. Can alter the appearance and behavior of webpages. This applies on all webpages. Browsing History: Can see when you visit all webpages.
(Apple really needs to display required permissions in the Information section of App Store listings so users can evaluate them before purchase.)
Webpage Contents: Can read sensitive information from webpages, including passwords, phone numbers, and credit cards. Can alter the appearance and behavior of webpages. This applies on all webpages. Browsing History: Can see when you visit all webpages.

Perhaps Stylish, an extension expressly for managing userscripts and one of the most popular add-ons of its time, best demonstrates the danger:

Apple provides a framework for Safari web extension developers to leverage the least invasive permissions possible. Happily, Justin Wasack did just that with his open source Userscripts extension:

Can read and alter sensitive information on webpages, including passwords phone numbers, and credit cards, and see your browsing history on news.ycombinator.com.

Combined with Vishal Patel's HN Dark Mode userscript (modified to handle the white flash, aka "flash of unstyled content" when navigating between pages on the site via @run-at document-start), it offers the least bad option for Safari users until HN offers native dark mode (or until Apple allows custom style sheets in Settings... → Advanced to apply to specific websites, as Firefox's userContent.css does via @-moz-document domain).

/mac | Jan 28, 2023


Subscribe or visit the archives.