I made an extension and needed to be able to quickly validate whether js was enabled. Surprisingly, there weren't any stupid simple websites to do that so I set out to make one. A few hours later <a href="https://isjsenabled.com/" rel="nofollow">https://isjsenabled.com/</a> was online.<p>I had a lot of fun carefully picking the colors, coding the site from scratch and stopping all work to solve a very tiny problem. It reminded me, there's nothing better than the feeling of having made something, no matter how small it is.<p>Thought it would be fun to share.
Minor, but instead of:<p><pre><code> status.setAttribute('style', 'display:none');
</code></pre>
I would suggest just writing:<p><pre><code> status.style.display = "none";
</code></pre>
(and similarly for the other DOM modifications; see [0] for a discussion of setAttribute vs property syntax)<p>[0] <a href="https://stackoverflow.com/questions/3919291/when-to-use-setattribute-vs-attribute-in-javascript" rel="nofollow">https://stackoverflow.com/questions/3919291/when-to-use-seta...</a>
This is what I get when viewed in Lynx which certainly has JS disabled.<p><pre><code> Picture of a browser window.
Javascript is disabled in your browser.
Javascript is enabled in your browser.
This text is in a <noscript> tag and should display if JS is disabled.
</code></pre>
<a href="https://imgur.com/a/RihgnoD" rel="nofollow">https://imgur.com/a/RihgnoD</a>
But... Why don't you just use the <noscript> tag?<p><a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/noscript" rel="nofollow">https://developer.mozilla.org/en-US/docs/Web/HTML/Element/no...</a>
I browse JS disabled. And if some page doesn't render and really want to read it, toggle it on with a single click using a browser plugin for that site only.
I always get downvoted for saying I run NoScript with a whitelist but 90% of my browsing time is on sites I've been to before and I don't think any other single security measure reduces your attack surface as much as turning JS off does.
A suggestion:<p>Given the recent news that Chrome will soon prevent ad blocking and given ads can run untrusted JavaScript, the only sane choice is to disable JavaScript in the browser.<p>I suggest that you change the "enabled" colour to red, to highlight the user's risky behavior.