Turning off JavaScript: Too much trouble, if you ask me

This would be the ugly secret of the internet, except everyone knows about it: the overuse of JavaScript makes the modern web slow and annoying to browse as well as possibly dangerous.

On the desktop, many people choose to restrain the beast with something like NoScript which allows the user selectively run/stop scripts using simple controls in the main window. On mobile, things are not as easy. Both Safari on iOS and Firefox on Android have an on/off switch for JavaScript (hidden in about:config in the case of Firefox). While there is a NoScript version for Firefox on Android, the experience of using it is (subjectively, I admit) “meh” at best. Chrome for Android has a per site JS ban hammer built in, but as with mobile NoScript you have to go through the menus to get to it and ain’t nobody got time for that! Which leaves my inner script tamer with the nuclear option: banishing the semicolon demon from my browsing experience entirely.

Since that is going to break things, is it even worth the trouble? If you are very concerned about privacy and security, then yes of course (although if that’s the case, you’ve probably turned JS off long time ago and don’t need me to lecture you about it).

If you’re like me just vaguely interested in making your browsing faster, safer and less annoying, then let me tell you how I tested how script-dependent a few aspects of our online lives are.

Transportation

Trying to catch a flight or a ride without JavaScript is often a no-go.

Flying with Aer Lingus, Iberia, Norwegian or Ryanair? Turn JS on or use the app. The British Airways, Greyhound and Amtrak websites maintained some functionality, but anything that required more than static text display was out of order.

Google Flights and Sky Scanner were equally JavaScript dependent. I didn’t really expect anything other than that, since even JavaScript not only provides the eye candy and fetches data without refresh, but also validates user input. In the end, the set of NoScript users is surely smaller than the set of Europeans trying to book a train to see the Independence Day fireworks on the 7th of April.

Shopping

Since I wasn’t getting anywhere (geographically speaking), how about a little shopping therapy?

Starting with Amazon, things at first didn’t look too good. Under a banner “Shop with 100% Confidence on Amazon”, there was a grey area with a frozen loading indicator and the cryptic words “Beep-boop-beep…”. Boo. Still, I was able to search for and order an extension lead that I needed for my house, so I guess in the end it’s “woo-hoo”. Annoyingly though, the currency selector didn’t work so I was forced to use Amazon’s Sterling to Euro rate, rather than my bank’s one.

Over at eBay it was much less plain sailing. At first it presented me with a fully functional (if not pretty) interface. But when I found the Mavic Pro I wanted and decided to place my €0.50 bid on it, I couldn’t log in. Clicking on the buttons didn’t do anything at all. When I temporarily enabled JavaScript, logged in and disabled JS again, I wasn’t able to place an order or make an offer either.

So that’s 50% success in the digital-only sphere. How about traditional retailers?

I started with Tesco and expected the experience to be fairly awful. I was in for a surprise. While everything looked as it probably used to in Netscape Navigator in the peak days of Limp Bizkit, the site was fully functional. Eye candy like fold-in menus and layout were the only victims. I needed to register first, which went flawlessly. I did the shopping and worked through the ASP-driven forms to select a delivery slot. The only problem was at payment, where in order to verify the transaction with the card issuer, I needed to enable JavaScript. That however was my bank’s doing, not Tesco’s.

The experience offered by Dunnes Stores on the other hand, was as gloomy as the expression on the face of the model showcasing a dress on their home page. I got as far as selecting categories, but instead of shirts or trousers I was invariably faced with “This category contains no products”. The exception was the “New In” category, which was actually populated. I tried to put something in to the virtual shopping bag, but that apparently caused an “Internal Server Error”.

I quickly left before my JS-less browsing took down the entire Dunnes infrastructure.

Lidl’s site looked like their shelves at closing time, due to components that failed to load. Aldi were the only ones so far that gave me a cookie consent pop up, but I couldn’t get rid of it. The rest of their site seemed to be there, albeit presented in a strange order. In a pinch one could get information about their products from it and since they don’t run an online store, that was as much as one could ask.

Enough of clothes and groceries, how about we get back to technology? PC World was about 25% functional. The menus didn’t work but I could select some stock from their home page. I got as far as the checkout with a PlayStation Classic, but then I couldn’t select the collection store and the whole thing fell through. I guess I’ll just stick to my Retro Pi.

News Outlets

Tired by all that relentless shopping, I figuratively dropped onto the sofa and turned on the news. The Guardian, this reporter is pleased to report, lost none of its functionality and almost none of its looks. The links and menus lead to the right places, all articles and photos were where they should be. Also apparently honey bees can do arithmetic (Five smart things honey bees can do)… but back to the point.

The BBC was a similar story (I couldn’t try the iPlayer but I assume it wouldn’t work). Huffingtonpost.co.uk showed me a desktop site, rather than a mobile one. Selecting and reading articles was OK, but ads and videos didn’t show.

Next up were “technical media”.

I didn’t expect anything here to work, because sites like The Verge just feel like they are made out of semicolons. As if to prove me right, Tom’s Hardware displayed its home page in one long piece with gigantic icons and article links strewn among them. Once I’ve selected an article, it was readable though. ZDNet’s menu didn’t work, but the articles that I could access from the home page showed just fine. The Verge seemed to work fine, except ads and articles.

Social Media

The experience on Facebook was horrifying, but when I switched JS off things improved, mainly because I couldn’t see the timeline.

It still showed me notifications and I could select at least some of them and see the actual post (and I will never unsee the photo of my ex-colleague taking a selfie on a treadmill – do people these days get other people to capture them taking selfies?). Strangely, selecting “request desktop site” and then going to m.facebook.com made the site work – I could see my timeline, select posts and so on.

Twitter didn’t work at first, but redirecting to mobile.twitter.com presented me with an ugly yet functional “legacy site” (although on Firefox that site took forever to load).

YouTube, Instagram, LinkedIn and Mastodon blatantly refused to cooperate until I switched JS on.

Top 17

Here is a more organized overview, compiled from the top most visited English-language non-porn websites according to this Wikipedia article. I’ve tested the sites on Firefox and Chrome on Android. The second “Works” column is added because some sites behave differently if you ask for a desktop version.

Site url Works on Mobile Works with “Request Desktop Site”
Google google.com search yes, but can’t sign in, so no Gmail or Calendar search yes, but can’t sign in, so no Gmail or Calendar
YouTube youtube.com not at all not at all
Facebook facebook.com no, unless first logged in via “desktop” yes, only m.facebook.com
Wikipedia wikipedia.org yes yes
Yahoo! yahoo.com not at all yes
Amazon amazon.com yes (some UI elements missing) worse then mobile
Twitter twitter.com yes (if redirected to
“legacy Twitter”)
no (fails to redirect to
“legacy Twitter”)
Outlook live.com not at all not at all
Instagram instagram.com not at all not at all
Reddit reddit.com not at all broken UI but serviceable
Netflix netflix.com can search, click on a video launches the app no (can’t get past main page)
Blogspot blogspot.com requires JS to sign in, but can read other blogs can sign in but not post
Twitch twitch.tv no (can see categories and video lists) not at all
LinkedIn linkedin.com no, requires JS to login no, stuck on “getting things cleand up” page after sign in
Microsoft microsoft.com text readable, images missing, shop not functional text readable, images missing, shop not functional
eBay ebay.com partially better than mobile
Bing bing.com text search yes, image search broken text search yes, other options missing

Speedtest

So by now I can tell that there are some websites that work with JavaScript turned off. Theoretically, they should be faster then, but by how much?

In order to find out, I chose a few sites, and tried to measure moving around on them with JavaScript turned on and off. Originally I intended to use automated scripts for maximum accuracy. The results looked like this:

Site Avg Load Time JS On Avg Load Time JS Off Difference
Google 5 2.4 2.6
Guardian 22.52 6.99 15.53
Wikipedia 3.97 3.65 0.32
Amazon 10.35 7.81 2.54
Twitter 4.78 3.6 1.18
IMDB 7.77 4.96 2.81
BBC 8.75 6.83 1.92
Android Central 14.96 8.79 6.17
Tesco 9.42 6.26 3.16

(Averages out of 3 tries, times are in seconds. Obtained using Selenium Geckodriver)

You can see that predictably sites load faster without JavaScript. But that didn’t show me what it feels like for a human to browse them, which is at the end of the day the most important “metric” – unless you are on metered connection you probably don’t care about all the bytes that still keep loading after you have already started using the page.

In the name of science then, I subjected myself to a more manual measuring. I created an “obstacle course” for each site (described below) and ran through it 20 times with JS on and 20 times with JS off. Because the awkwardness of doing this on a smartphone was affecting the results, I switched to desktop Firefox, but changed the user agent and the viewport using the Developer Tools.

The user agent I used: Mozilla/5.0 (Linux; Android 7.0; SM-G892A Build/NRD90M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/67.0.3396.87 Mobile Safari/537.36

The viewport: 740×360

The “course”:

  • go to amazon.co.uk, look for The Hitchhikers Guide to the Galaxy, select the omnibus edition, scroll down to “Customers who bought this item also bought”, select Dirk Gently’s Holistic Detective Agency (Dirk Gently Series Book 1), scroll down to read the description
  • go to tesco.ie select “Groceries”, search for “fish fingers and custard”, select “Cully And Sully Superior Fish Pie 400G”, scroll and select”Instructions”, wait to see the page text
  • go to theguardian.com, select “Science”, scroll down and select “Why the zebra got its stripes: to deter flies from landing on it”, scroll down and select “Contact Us”, wait to see the page text
  • go to m.gsmarena.com, select “News”, scroll down and select “DxOMark’s test of the Mi 9 ends with the best video score ever”, scroll down to “Related” and select “DxOmark tests Pocophone F1, its camera matches the iPhone 8”, scroll down and select “Privacy”, wait to see the page text.
  • go to wikipedia.org, search for “JavaScript”, scroll down to “Beginnings at Netscape”, select “NCSA Mosaic”, scroll down to “History” and select “X Window System”, wait to see the page text.

Each site was tested independently in 20 different runs.

The results:

Total numbers All Tries JS On All Tries JS Off No. of Tries Average JS On Average JS Off Difference
amazon.co.uk 389.7 339.65 20 19.485 16.9825 2.50
tesco.ie 322.05 324.91 20 16.1025 16.2455 -0.14
theguardian.com 371.28 242.12 20 18.564 12.106 6.45
m.gsmarena.com 304.3 245.24 20 15.215 12.262 2.95
wikipedia.org 245.33 235.65 20 12.2665 11.7825 0.48

The experiment was obviously highly affected by me being a human rather then a computer. To eliminate outliers caused by glitches in wetware, here are the fastest 10 times out of 20:

Best 10 out of 20 All Tries JS On All Tries JS Off No. of Tries Average JS On Average JS Off Difference
amazon.co.uk 157.31 142.91 10 15.731 14.291 1.44
tesco.ie 134.2 132.7 10 13.42 13.27 0.15
theguardian.com 134.22 96.98 10 13.422 9.698 3.72
m.gsmarena.com 113.19 100.68 10 11.319 10.068 1.25
wikipedia.org 98.57 94.18 10 9.857 9.418 0.44

Not much difference, is there? As the Tesco result shows, switching JS off can even make browsing slower, because the UA is harder to navigate (in this case the elements weren’t folded and it lead to longer scrolling).

Conclusion

So, what’s to take away from all this? As a web user, there is not much I can do – disabling some of the more prevalent advertising scripts with an adblocker could spare me a few seconds here and there, but disabling all scripts is not really an option. So, unless a severe vulnerability makes me go “JS-dark”, I’m not banishing the semicolon demon from my browser.

Leave a Reply

Exclusive tips, how-tos, news and comment

Receive monthly updates on the world of mobile dev.

Other Afilias Products

Try the world’s leading device detection solution at
DeviceAtlas - Try the world’s leading mobile device detection solution

Evaluate your websites’ mobile readiness with
mobiReady - Evaluate your websites’ mobile readiness.

© 2019 Afilias Technologies Ltd. All rights reserved.

This is a website of Afilias Technologies Ltd, a private company limited by shares, incorporated and registered in the Republic of Ireland with registered number 398040 and registered office at 6th Floor, 2 Grand Canal Square, Dublin 2, Ireland