28

Does a browser download JS files if the user has JS disabled?

I'm wondering if the browser downloads the JS files and ignores them or ignores the download all together.

Do different browsers act differently in this case?

Edit:

I asked a follow up question to this question here.

Community
  • 1
  • 1
Bryan Downing
  • 15,194
  • 3
  • 39
  • 60
  • 3
    +1. A fine question, though one to which you could discover the start of some answers with five minutes and Charles.. :) – Ben Zotto Aug 04 '10 at 01:10
  • 1
    Which browser are we talking about, and *how* is it disabled, this varies :) – Nick Craver Aug 04 '10 at 01:11
  • 1
    @quixoto Not sure who or what Charles is... @nick All browsers. Does it matter how JS is disabled (in the scope of this question)? This is a generic question without a specific application. If JS is disabled, a user should not have to wait for the files to download. I'm just wondering if browsers largely take care of this natively. – Bryan Downing Aug 04 '10 at 01:16
  • 4
    Charles, very handy: http://www.charlesproxy.com/ – danjah Aug 04 '10 at 01:19

2 Answers2

16

Some testing (on Ubuntu 10.04) so far yields

  • Opera: doesn't download (disabled JS in preferences)
  • Firefox: doesn't download (disabled JS in preferences or with NoScript)
  • Google Chrome/Chromium: downloads (disabled JS via -disable-javascript parameter)
  • SRWare Iron (Chrome without the nonsense): doesn't download (disabled JS via "Options" - "Under The Hood" - "Content Settings" - "JavaScript" - "Content Settings" - "Do not allow any site to run JavaScript")
  • IE 8: doesn't download
  • IE 7: downloads

Edit: Made this a community wiki, so feel free to add your results.

Bryan Downing
  • 15,194
  • 3
  • 39
  • 60
Ventero
  • 10,935
  • 2
  • 23
  • 21
4

The best way to find out something like this is to use a tool like fiddler With this tool you can examine a web request and see exactly what is going on. As Nick says above different browsers may act differently, but at least this will let you know for sure.

Dylan
  • 1,306
  • 1
  • 11
  • 29