• Home
  • Blog
  • Contact
  • Projects
  • Content Mirror
  • Matrix Guide

  • My Site Works Without JavaScript

    April 29, 2022

    It's true. My entire website can be browsed without any JavaScript whatsoever. You can verify this for yourself too. Not a single piece of JS is ever loaded when you hit my domain 1. It never was, either. This is not some new development. But it is great news. Why, you ask? What's so bad about JS?

    Well, first of all, it is horribly insecure. The idea behind JS is that you're running arbitrary code from someone's server directly on your computer without even seeing it first. It just all happens automatically. I won't go into to many details, because that's not the point of this post. But suffice it to say that very few people have any understanding of the security risks of browsing the web. To be clear, most of the JS on the web is harmless. It's just to get that swooshing menu to work right. But there are plenty of nefarious uses for JS that are often overlooked, and by having JS enabled in your browser, you are putting yourself at risk.

    I'm very outspoken about this on my blog, but I will say it again to be crystal clear: I believe the web should be about content. Not about fancy menus and crazy user interfaces. Just content. Nothing more, and nothing less. JS does not suit this vision very well. It offers dynamic content that can be hard to fetch and uses a lot of bandwith for things that users don't even need to see anyway. As such, my use of a browser that does not even support JS in the first place is not my problem, but the problem of web developers. I should be able to comfortably navigate the web without JS, and if you're a web developer, it's your job to cater to that. I've done my part; everything I want to show on my site, I can and do without JS.

    The question that I would like an answer to is why developers think they need JS in the first place. It's not like you need it to submit forms, because HTTP has that functionality baked in. That already means that login pages and whatnot should just work without JS 2. When I think about all the possible use cases for JS, I think that it tends to just be more for convenience than anything else. And maybe it is a little bit of the mentality that it could be done, so why not do it? Well, I think I've made it very clear why it should not be done.

    You may point out that there are plenty of web protocols such as Gopher and Gemini that are purely content-based. But let me point out that I don't have a problem with the HTTP protocol. HTTP is great for downloading files, and serving HTML pages. I'm sure the protocol itself could have been designed better, and HTML is pretty verbose, but they have been doing their job since the 90s, and I have no complaints with that. I'm just really not a fan of my browsers running code that I don't have control over. That's not what the web was made for, and I refuse to use it that way. Anything I want to do on the web, such as read articles, search for things, and buy products, should all work without JavaScript. I should be able to log in to my webmail and it should just work 3.

    Even my school and work should work without JS. I shouldn't need to have a bloated, JS-enabled browser just to get past the login screen to get into my school's CMS. Likewise, I should be able to click a link and download a file without having JS available. There is literally nothing I do on the web that should require JavaScript. If you want to run code, you can run it natively. There are plenty of cross-platform programming languages and frameworks that will do the job. And if you need a server, just set up an HTTP API that your app can talk to. It's as simple as that. Well, relatively. I mean, I know you'll be writing a lot more C than you will JS to perform comparable tasks, but that, I think, is a feature, not a problem. It encourages developers to keep things simple, and users to not have such high demands.

    For example, if YouTube can't play a video without JS, then it can just let the browser play them directly from the HTTP server, or let a dedicated player such as VLC play them. The comment system can just use POST. There's no reason that Netsurf shouldn't be able to browse YouTube. Google News is another notoriously bad interface. Why does it load so much JavaScript just to display a list of articles? I tend to pick on Google sites the most because they are pretty much the worst, but I'm sure all the social media sites are just as bad. Perhaps the one exception to this is Reddit, which still offers its "old" interface that actually works fairly well without JS. Reddit proves that even social media can exist without JS.

    I think I've made my point pretty clear, and I am trying to use Netsurf for just about everything I can, only switching to Firefox in cases where I absolutely have to for reasons beyond me, such as school or work. But for all my personal computing, I'm totally free of JS. And if your site breaks because of that, then your site won't get my traffic.

    I would highly encourage people to "downgrade" their browsers to dumb browsers that don't support JavaScript, because this will force websites to support them. There's a very scary thing going on with the Web right now, and that is that there's no browser diversity. Google Chrome has the vast majority of the market share, and this is problematic (1) because Google bakes in a ton of advertising and tracking stuff, and (2) because Google can add non-standard functionality and get away with it because then websites can just expect you to have Chrome, and if you don't, they'll just tell you to use Chrome.

    In this way, the rest of the browsers get left behind, and Google maintains its monopoly over the internet, which is of course bad because it means a huge loss in freedom.

    1. Fun fact: not a single bit of CSS is loaded either. I just don't need it. I don't see the point. My site delivers content, not a flashy interface. Content is way more important anyway, and I think CSS distracts from this a little bit. 

    2. That should just be a given, but I actually can't even log into my school webmail or any Gmail account without JavaScript... curious. 

    3. Google has a plain HTML mode for Gmail that I almost gaurantee works without JS. This proves that it is more than possible. I mean what's so hard about POST-ing an email to the server? Why does it have to be all AJAX and whatever other garbage is going on? 

    © 2019-2024 Jordan Bancino.