Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> If you visit my website, I am granted the honour and the privilege of executing arbitrary Javascript on your computer. > > This is a pretty bad idea

This is why I disable javascript by default, but I suspect that on this page it's needed to fix the theme or something, because the text is light grey on a white background, and all monospace sections are completely illegible.

Edit: I don't mean to hate on the author, the content of the article is really interesting!



> I suspect that on this page it's needed to fix the theme or something, because the text is light grey on a white background, and all monospace sections are completely illegible.

You seem to be correct. I found a single <script> tag in the source, with the following code:

    (() => {
        let v = localStorage.getItem("color-scheme"),
            a = window.matchMedia("(prefers-color-scheme: dark)").matches,
            cl = document.documentElement.classList,
            setColorScheme = v => (!v || v === "auto" ? a : v === "dark") ? cl.add("dark") : cl.remove("dark");
        setColorScheme(v);
        window.setColorScheme = v => {
            setColorScheme(v);
            localStorage.setItem("color-scheme", v)
        };
    })();
Though I don't see what's the point of this since the "light" theme, as you've pointed out, is completely illegible.


my FF is set to tell webpage to use dark theme and I get light gray on white (Chrome without that displays it fine).

Looks fine if I inspect and set the bg color to black so I think author just didn't test dark theme properly...


That’s a selective quote…

> This is a pretty bad idea, but luckily even the web browser has its limits.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: