What is a script blocker and what does it do?

305 views

Also, how does it work and what are some examples of it?

In: Technology

It’s simply a way to disable JavaScript from running on your browser it prevents some functionality and also block malicious scripts

Javascript can be added to websites to make them more interactive. Short animations, search boxes, infinite scrolling, that sort of thing.

Javascript can also be used in more obnoxious ways, such as pop-ups, tracking, or blocking right click.

Script blockers stop Javascript from running on pages. Depending on the specific extension it may block all scripts or only specific scripts that the extension developer flagged as problematic.

It helps to understand how pages are loaded in a browser.

First: the “page” is just a big mess of text when the browser first gets it. That text uses special rules to form a “markup language” named HTML. (A “markup language” is a fancy term for a way to write text that makes text look fancier when a program processes it. You know how you can make text bold with * asterisks on Reddit? That’s a simple markup language!)

Once the browser gets the text, it starts “parsing” it. That’s the fancy word for reading the text and deciding what it means. Some parts of the HTML language tell the browser either there is a “script” file that should be downloaded *or* some part of the text is in fact not HTML, but a script.

A “script” is some more text, but this time instead of a markup language, it’s a programming language. These days it’s usually JavaScript, but technically it can be any language the browser supports. Scripts exist to do things. They contain small programs that might change the HTML after the browser is done with it. See, HTML isn’t what we call “dynamic”. That means without scripts, an HTML file looks one way and can’t change. You know how sometimes stuff on a page gets bigger when your mouse is over it? That’s *impossible* with just HTML. Scripts are one way to be able to make that happen.

(Some programmers get really upset if HTML is or isn’t called a “programming language”. They worry if it’s called a “markup language” then people think it’s easier. HTML is a simple language to describe and a hard language to understand fully once scripts and something else called “style sheets” get involved, and people who say otherwise probably haven’t ever really had to use them.)

Anyway, once the browser sees there’s a script to download, it downloads it. Other parts of the HTML might tell the browser to run some or all of the program code in the script.

A lot of times scripts are used for things you might not like. It’s extremely common for scripts to try to glean information about you from your browser, then load ads. Sometimes they’re innocent and only for some fancy effects, but scripts can take time to run and also make your CPU work harder. Sometimes they do even more malicious things, like try to steal data from you.

So browsers support “extensions”. These are programs that run inside of the browser and are able to do things to web pages. A “script blocker” tells the browser it wants to be part of loading pages. So when the browser starts parsing the HTML, it tells the script blocker what it’s parsing. When the script blocker sees a script is about to be loaded, it decides if it thinks that script is good or bad. If it thinks that script is bad, it tells the browser to not bother loading it at all. If the script doesn’t load, it doesn’t run.

A webpage generally consists of four things:

– Html: it describes the structure and the content of a webpage
– Css: it describes how a webpage looks
– Javascript: it adds behavior to a website
– Static assets: images, videos, sounds etc.

A script blocker will block Javascript from running.

Why you would use a script blocker:

– less load on your system, since complex and poorly written Javascript can use a lot of resources
– some people don’t want third party scripts running on their system without their explicit permission. This is mostly out of principe
– some people want to block only certain scripts like the ones that track you or collect data from you
– although modern browsers are *very* secure (if kept up to date!!), some people are afraid that some malicious script will do harm to them or their devices

Why you don’t want to use a script blocker:

– modern websites use a lot a Javascript for even their basic functionalities. Some doesn’t even load at all without Javascript enabled or if it’s blocked