DEV Community

Ben Halpern
Ben Halpern

Posted on

Should browsers still allow users to disable JavaScript?

We asked the question "Should browsers still allow users to disable JavaScript?" in the State of the Web Survey we just finished up with, and the results might be surprising.

Nearly forty percent of our lovely community members voted that browsers should no longer allow users to disable JavaScript.

The feelings involved here cannot fully be expressed merely as a binary. What are your thoughts on this subject?

Oldest comments (77)

Collapse
 
j_mplourde profile image
Jean-Michel Plourde

There is lovely extension that does that job anyway to block javascript. My favorite being noscript

Collapse
 
tux0r profile image
tux0r

I moved on from NoScript to uMatrix. If you're interested in technology and you are fine with having to spend a couple of days to configure your whitelist, the two-dimensional matrix might be a superior choice than NoScript's "Yes/No".

Collapse
 
j_mplourde profile image
Jean-Michel Plourde

Yes, I am aware of uMatrix and how it is designed to work with uBlock Origin which I have. Fortunately NoScript is working well and I am good with the "Yes/No/ behavior.

Collapse
 
theycallmenucci profile image
Steve Antonucci

As long as JavaScript can still be used to abuse the user and their experience on the client-side, yes browsers should still allow JavaScript to be blocked.

While it may degrade their experience to do so, it is a conscious choice by the user in this case and not something forced upon them by malignant code.

That's my .02 anyway. 😎

Collapse
 
ben profile image
Ben Halpern

I buy this. Frankly I’m pretty amazed by this vote split.

Collapse
 
theycallmenucci profile image
Steve Antonucci • Edited

I am too Ben. Very interesting. Thanks for calling it out.

I wonder if the split is maybe correlated between older and younger developers? It would be interesting to see if there's any particular pattern amongst the voters on each side.

Collapse
 
pbnj profile image
Peter Benjamin (they/them)

I am not amazed by this vote split. This is a classical example of self-selection bias.

Collapse
 
adhocore profile image
Jitendra

but does that come with the need of a version of web that just works without JS? now with the rise of all cool JS frameworks and paradigms things are much different than just losing small part of something when JS doesn't work, the whole site even doesn't render. so while it is upto user to disable their browser from executing JS but the site owner/developer should make sure they address those users.

Collapse
 
jvanbruegge profile image
Jan van Brügge

Just for performance reasons, you shouldnt require Javascript for your side to load. If you write your app in JS, get Node to render it on the server for you like in the old days.

I really get annoyed when a page just presents a basic shell and starts loading content with JS, for no particular reason. Design your websites so they are usable even without JS, it's not that hard

Thread Thread
 
adhocore profile image
Jitendra

apps delegating heavy lifting to browsers is also for saving server resources :)

Collapse
 
jshamg profile image
jshamg

I totally agree with you Steve. There are for example a lot of paranoid Linux guys that are using the Web in a Javascript free way. I know a couple :D. We shouldn't exclude them when developing browsers and Web pages. I always think about how my site works without Javascript and that all content is accessible in a certain way.

Collapse
 
theycallmenucci profile image
Steve Antonucci • Edited

Thank you jshamg. I'm a Linux guy myself. 😎 Though not a paranoid one... well... anymore. 😂

I'm glad that you're considerate and inclusive of your user's situations and content accessibility. We should all follow your example. 👍

Collapse
 
tux0r profile image
tux0r

My thoughts on the subject at hand are what I have expressed numerous times over the past few days alone: We should actively contribute to the common knowledge. It is our job to explain why "oooh, it's shiny" also means "oooh, it runs other people's code on my computer".

38.9 percent - a surprisingly small number! - of all voters seem to consider their web browser to be a replacement for an actual operating system. Now DEV is rather web-focused in some aspects, and you'd get very different results in a C community or something...

There is no excuse for a website to not display anything without JavaScript enabled. Many web developers make that mistake though, thinking that "nobody disables JavaScript anyway". Let us change that!

Collapse
 
rhymes profile image
rhymes • Edited

I recently had a conversation with @mangel0111 in the comments of his post How to survive to Chrome for Android disabling JavaScript for 2G or slower connections?.

My answer is yes:

  • yes because some websites are out of control on how much JS they deliver
  • yes because of trackers (kudos to Firefox that's going to disable them by default)
  • yes because a sizable chunk of the planet is still on 2G/3G (even in first world countries)
  • yes because a sizable chunk of the planet is still connected through satellite (even in first world countries)
  • yes because this "sword of Damocles" looming over use might force us web dev folks to rethink our choices and put the user back at the center. This made me think quite a bit: Dear Developer, The Web Isn't About You

I love JS but it's admittedly easy to lose perspective and go down the rabbit hole.

Update: another nice article about this subject is The Bullshit Web

Collapse
 
theycallmenucci profile image
Steve Antonucci

Thanks for the link to the Dear Developer article! I enjoyed the read.

Collapse
 
philnash profile image
Phil Nash

I was going to point out the Android Chrome 2G plans too. Not only will browsers continue to allow users to block JavaScript, they may also choose to themselves.

Great other reasons here 👍

Collapse
 
rhymes profile image
rhymes

Thanks!

Collapse
 
gypsydave5 profile image
David Wickes

Good list, good reasons. Two thumbs up!

Collapse
 
rhymes profile image
rhymes

thanks!

Collapse
 
ben profile image
Ben Halpern

This is exactly the thing that was referenced when I had this convo IRL.

Chrome JS disabling on 2G is exactly the antithesis to this discussion.

I think we need to realize the difference between things that should be more like documents and more like rich applications.

DEV is rich, but it's like documents. If you come from Google to a post, you're here for the document. If you come to comment, message, react, interact in other ways, you're here for the application. Both are relevant use cases. The further you get into interactions, the more likely it will be that something might work, but the basic experience is document-driven.

Not that we do everything right but that's how I think about it.

Collapse
 
rhymes profile image
rhymes • Edited

Agree Ben.

Hopefully no one will introduce a standard HTTP header to tell the browser if the page is just a document or an app :D

Collapse
 
michaelgv profile image
Mike

I usually end up browsing with JavaScript off or severely limited - intentionally - any site which forbids me to block JavaScript I won’t access.

Collapse
 
philnash profile image
Phil Nash

It doesn't matter whether a user can block JavaScript or not.

Loading scripts normally relies on the network, there is always the chance that the load will fail and the user will be left without the site's JavaScript anyway. Or it will partially load and only part of the JavaScript will be available.

This is not the user's fault, nor the developer's fault. But regardless, you now have a user on your site without JavaScript.

1% of all JavaScript requests on Buzzfeed timeout, that's 13 million requests a month.

It is up to developers to make their sites work (or at least fallback gracefully) whether JavaScript is or isn't available. The reason for JavaScript being unavailable, whether it's user choice, network conditions or browser interventions, is unimportant. Building a resilient experience is the only way we can serve our users best.

Collapse
 
gypsydave5 profile image
David Wickes

It is up to developers to make their sites work (or at least fallback gracefully) whether JavaScript is or isn't available. The reason for JavaScript being unavailable, whether it's user choice, network conditions or browser interventions, is unimportant. Building a resilient experience is the only way we can serve our users best.

Quote of the day for me.

Collapse
 
ferricoxide profile image
Thomas H Jones II

I can only assume that the 38.9% that said no fall into three camps:

  • They don't know what JS is
  • They've never been on the receiving end of JS-based abuse
  • They're developers who care a little bit too much about whether the JS code they've slaved over gets seen.
Collapse
 
ignoreintuition profile image
Brian Greig

Content is the reason users are coming to your site. Javascript should be used to enhance the experience. Your site should degrade gracefully allowing users to turn off JS and still access the content they came for.

Collapse
 
alephnaught2tog profile image
Max Cerrina

I honestly don't feel like it's that hard of a question, but I guess it is more divisive than I thought. I feel like for many things, you can opt in or out -- don't want to use Photoshop? Use Gimp! Hate Java? Use only Swift-based stuff! (I am making stuff up here.)

But you really can't do that for the most part with the Internet. There's mostly just one of it, and you use browsers to interact with it. You caaaaaaaaaaaaaaan argue that "people who don't want to use Javascript can just skip the Internet" but that seems a) well, rude, frankly and b) the Internet is pretty solidly filling a real big spot in the world that is not easily replaceable.

Doesn't mean your site has to do a damn thing for them. (I mean, I personally think you probably should, but.) If you don't want people with no Javascript to use your site, that's just fine, then just ... offer them nothing, I guess, or offer them a really shitty user experience?

I just honestly cannot fathom any reason for feeling that users shouldn't be able to disallow it on their own browsers.

Collapse
 
joshualjohnson profile image
Joshua Johnson

Yes allow users to disable. The internet wasn’t built on JavaScript. It was built on html. JavaScript is a secondary artifact of the internet.

Collapse
 
danieljsummers profile image
Daniel J. Summers

Of course a user should be allowed to disabled JavaScript, or images, or CSS, or any other thing. Their browser, their bandwidth, their connectivity fees, their choice.

That doesn't mean that sites can't say "Hey, friend - we need JavaScript to be useful; if you don't enable it, you won't be able to use our site." (Same last sentence as the paragraph above...)

:)

TL;DR - 38.9% of respondents need some perspective.

Collapse
 
dfellini profile image
Dan Fellini

I firmly agree the consumer should be allowed to disable whatever they want.

But please understand, from my perspective as a one-dev shop at a nonprofit, I can't be all things to all people. I wish I could. But it's just not possible. So, when I build a JS-dependent page, it gets a noscript saying, "Sorry. Wish we could do better but we don't have the resources."

Does that suck? Kinda. Am I ok with it? Totally.

Collapse
 
abhishekcode profile image
Abhishek Singh

Hi, actually that's far better message than saying 'please enable Javascript' you are doing good

Collapse
 
quii profile image
Chris James

Have you considered how it might be cheaper to write a website with a progressive enhancement mindset instead? (obviously depends a lot on what you're building)

Collapse
 
sethusenthil profile image
Sethu Senthil

Yes they should, probably not browsers like Google chrome but browsers like Tor should definitely keep this feature for security reasons. Believe it or not the dark web is mostly just HTML and CSS with super minimal JavaScript.

Collapse
 
gypsydave5 profile image
David Wickes

Sounds like sites on the dark web are written by people who know what they're doing.

Collapse
 
kspeakman profile image
Kasey Speakman • Edited

I don't disable Javascript. Most of the apps I write will not function with JS disabled. I am not aware of the use cases for running a browser with JS disabled in the web of today. (Maybe someone else can fill in that info.) But I support end users having the choice to do so.

Collapse
 
matansilver profile image
Matan Silver

Often sites that rely on JS to render content are difficult for accessibility programs to interpret, which matters greatly for people with vision disabilities and others. Many people also don't want to allow a site they may not trust to use their computer's resources to do who knows what--plenty of apps have even been caught mining cryptocurrency on client hardware with JS. Ever click a link to Imgur and have to wait 10 seconds... for an image? HTML/CSS has a very small attack surface. With all the security scares in NPM, are you confident that you aren't opening your clients up to unnecessary risks? I'm not.

As a developer, rendering on the server allows you to cache content much more aggressively, across multiple clients, and not just cache content per client locally. Sometimes I don't want to make a single page app. Sometimes, applications fit very well into the CRUD model, and it is just so elegant to do that server side and with forms.

Collapse
 
zeddotes profile image
zeddotes

Hellz na