DEV Community

Ben Halpern
Ben Halpern Subscriber

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?

Top comments (77)

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
 
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
 
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
 
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
 
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
 
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
 
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
 
theycallmenucci profile image
Steve Antonucci

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

Collapse
 
gypsydave5 profile image
David Wickes

Good list, good reasons. Two thumbs up!

Collapse
 
rhymes profile image
rhymes

thanks!

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
 
mortoray profile image
edAโ€‘qa mortโ€‘oraโ€‘y

I feel my article about ads is relevant here. The primary use of JavaScript appears to be invade user's privacy and inject stuff from external places.

I'd be happy with an option to disable third-party JavaScript. Only JS coming from the same domain would be allowed.

Collapse
 
alephnaught2tog profile image
Max Cerrina

disable third-party JavaScript

I like that idea a lot.

Collapse
 
jvanbruegge profile image
Jan van Brรผgge

It's not hard to serve the script from your domain instead, just use a reverse proxy. This is not really a solution at all

Thread Thread
 
mortoray profile image
edAโ€‘qa mortโ€‘oraโ€‘y

It makes a difference though. A reverse proxy avoids one of the problems with tracking by third parties. No longer does the Google CDN get knowledge of everybody who accesses your website.

Security is also improved since the domain of origin of this script is the same as the host domain. Combined with limited third domain access it neuters some of the abuse that JS can currently do.

It also serves all the content from one domain, allowing a single HTTP connection to be used. This reduces connection overhead and speeds up the page.

It also forces the content to be handled by the host domain, which then puts a little bit of pressure to not overload the hosting.

Collapse
 
carlosmgspires profile image
Carlos Pires
  1. Your chart lacks labels.
  2. YES. My computer is my property. It is not the property of web developers. Asking such questions is akin to asking "Should TV stations allow audiences to use their remote controls?"
Collapse
 
thorstenhirsch profile image
Thorsten Hirsch

Thank you Carlos for bringing this up (#1).

@ben : Please use labels. You're using blue for no and red for yes. Come on - that's crazy!

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
 
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
 
garthvador profile image
Quentin Caillaud

Reading the answers (except @rhymes answer, sory if I missed others...), I notice that even if internet is supposed to be worldwide, in the developers mind it is thought only for occidental world (I am guilty of that too).
We often forget that there is a lot of people in the world with a very limited access to the web, and js can ruin their access to your creation.

It is not really the internet I want to see.
It's nice to have js, but it should also work without it.

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.