logoalt Hacker News

The <Noscript> Element as a Trap

9 pointsby speckxlast Tuesday at 1:48 PM6 commentsview on HN

Comments

creatoneztoday at 4:28 AM

Indeed, <noscript> doesn't show just because the page didn't properly load the scripts in the page. It's not a fallback for errors, it's a fallback to serve users who deliberately disabled Javascript. This is a rare scenario these days, but it does get displayed when you disable JS in Tor Browser, use the disable Javascript button in uBlock Origin (I personally use this to whitelist javascript per-domain), or use various other extensions like NoScript. This is dependent on the implementation, though. In theory some crappy browser extension could provide JS disabling functionality otherwise identical to tor/ublock/noscript but forget to display <noscript>s, but I haven't heard of implementations that are like this.

Either way, make sure you have something sensible to display for all scenarios, even if it's just an error page. Mysterious blank pages are not fun.

sublineartoday at 3:06 AM

> Because the problem is, JavaScript can fail to load in several ways. Here's a non-exhaustive list of cases...

The author answered their own question. In even the best effort case, noscript is the fallback.

I'm not even sure what they expect the website maintainer to do for most of that list. If they knew themselves, they would have put it in the blog post. Is this instead a call to draft new w3c specs or revisions? What am I misunderstanding? For a site that has "hacktivism" in the domain name, whining like this is a bad look.

show 1 reply
antonvstoday at 2:44 AM

FTA:

> “One of the few traps of the web”

…for some large value of “few”