https://developer.mozilla.org/en-US/docs/Web/CSS/@media/scri...
https://www.naiyerasif.com/post/2023/12/17/detect-scripting-...
Nowadays, unless you are serving developing markets, supporting legacy technology, or your website is truly just some basic static pages, it’s a buzzword programmers use to flex on each other. That’s about it.
I personally find it annoying because I grew up as a junior right at the inflection point, when all the tutorials were still saying it was the right thing to do. That’s a lot of work to do for something nobody - and I mean literally nobody - in the real world cares about anymore. I would sooner brag about how my blog still works on Safari bundled with Snow Leopard.
Many of us that know how security works on the modern web browse untrusted sites without JS enabled.
Exploits aside, the amount of user-hostile irritating annoyances that just disappear without JS is also worth mentioning. Many years ago, I remember a site that was completely usable, yet continually begged me to "enable JavaScript for a better experience!", so I tried it and was immediately inundated with popups, moving flashing crap all over the page, and other things that I did NOT consider a "better experience". Never again.
Did you know that HackerNews is 99% functional with JS turned off by the way? The only thing missing is the ability to collapse threads.
Idk, I honestly doubt that. In my experience the people using outdated browsers are on old mobile devices and some "special" enterprises micromanaging employee software installs
And technologically illiterate apple users (because Safari doesn't Auto update like Chrome and Firefox)
You can run some JS to prove you're running JS. Can't you write in your site's CSS:
.d-js-required { display: none; }
and (in JS) remove that class on each element it's on?https://developer.mozilla.org/en-US/docs/Web/HTML/Global_att...
<script>document.body.classList.add("hasJS");</script>
And the corresponding CSS: .js{display: none;}
.hasJS .js{display: block;}
Or you could just copy it from the address bar?
1. They don't understand URLs. That's not too surprising to be honest, URLs are pretty complex things.
2. They've been burned enough times by crap SPAs that they don't instantly assume something they are looking at has a dependable URL they can copy and share.
Thanks to 2 I've recently started rethinking a bunch of my own projects - I think I need to add explicit "share" buttons that copy URLs to people's clipboards for them.
I really just put the URL at the end of the page with a `user-select: all;` to make it easy to copy _after_ you've read the content. It's also rendered server-side so even if I used utm or some other tracking things, the query params would automatically not be included in the server-rendered share link, just the permalink to the post.
But to the original authors point, I also do find myself often just copying from the address bar and then manually deleting a bunch of the garbage at the end of URLs. Maybe that's why I thought it nice for a simple "copy this link" when JS is disabled.
Very loosely related: why do so many websites use require Javascript to handle links? I’m so tired of trying to figure out how to open a given link in a new tab. :-(
I am finding myself afraid of clicking any link, anchor, or button in the fear of losing the current position, word wrapping or the current form inputs.
It's like I am being pavlov trained to be afraid of interacting with my computer.
- Microbrowsers exist. They're the things that generate previews in messaging apps and social media.
- Ad blockers. Because the advertising on the Web has become a complete dumpster fire even the FBI recommends ad blockers. They can break stupid JavaScript functionality. Partially loaded JavaScript can cause additional load on the back end with retries or missing completion conditions.
- Crappy cellular. Cellular data remains unreliable and its reliability is not evenly distributed. A user can go from a great signal to shitty back to great through no fault of their own. You can't be guaranteed all your shitty JavaScript will even load.
- Spiders. Spiders have varying amounts of support for JavaScript, not everything is some variation on Chrome.
It's my device and I should get to decide what code I run in it, what software I use, how that software displays content to me and how I interact with it.
Reminds me to the WordPress / PHP scourge of the 2010s. "You don't understand, we have to dynamically serve our site using PHP, and have an extensive CMS that we can barely use ourselves so we'll will still constantly reach out to you about." And then the site is barely more than a brochure or a blog.
“[Progressive enhancement] was just an idea by a few niche people who wanted to disable 1/3 to 2/3 of their browser's technology then demand that web-site operators/builders spend a lot of time and money on implementing for that sub-1% population. They didn't, and these people had no real leverage.”
When progressive enhancement was the thing, nobody wanted to "disable 1/3 to 2/3 of their browser's technology", browsers mostly lacked many of modern CSS and JS enhancements across the board and having them fail graciously while still using modern features for the few who would support it was just the professional thing to do.
It sill is today of course, but it is obvious there are not many professionals left in webdev.
Even for my own projects, I don’t care anymore; there’s a warning to turn it on with a <noscript> tag, and the whole page is otherwise hidden.
HN had the eulogy (with some kicking and screaming that it was premature) back in 2013. https://news.ycombinator.com/item?id=6316516
(Which apparently is most web developers these days. Sigh.)
Meanwhile, out on the open web, people build progressively enhanced solutions all the time.
+ Low-powered or -specified devices don't like Javascript-heavy elements. For example, canvas elements - do people with steam-powered mobile phones really need to see that JS-heavy canvas animation? Wouldn't a static image do just as well for them? Same goes for intensely animated SVG scenes.
+ Apple News. JS is not a thing in AN. If you need to press a web article so it can be distributed via AN, be prepared to rip every shred of JS out of it - something that's a lot easier to do if your article has already been built with progressive enhancement in mind.
But a CRUD-heavy app with forms and modals and many moving parts? Forget it. It’s about as relevant as people using IE.
2 years ago, again on HN, someone asked if progressive enhancement “lost the war.” In reality, it never showed up for battle on its own merits.