Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disabling loading specific JavaScript files with Firefox

I am looking for a way to prevent loading a specific JavaScript file on a website for any website of choice, with Firefox.

For example: Say I don't want to load jQuery (when loading the page, not afterwards 'disabling' it). I then want to be able to set that

http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js

should not be loaded. The browser should complete ignore this to debug other JavaScript on the website. I don't have access to the domain directly, so that is why I am trying to do this via the browser.

So for clarity: :) I don't want to disable scripts from a certain domain, but want to be able to disable certain scripts. It can be that 10 scripts are on 1 domain, so killing all 10 of them is not what I want; in that case I want to prevent loading only one.

Is there a way to do so?

like image 888
Sander Avatar asked Jun 09 '11 11:06

Sander


People also ask

How do I disable JavaScript in my browser?

Press Control+Shift+P or Command+Shift+P (Mac) to open the Command Menu. Start typing javascript , select Disable JavaScript, and then press Enter to run the command. JavaScript is now disabled.


2 Answers

Several options:

  1. Use the Addon "Adblock Plus". It will probably still accesses the js but does not execute it.

  2. Use the Addon "Greasemonkey", which - when cofigured right - does not even touch the js-url. But its generally harder to configure right. ;)

  3. Have a look at Firefox's buildin security policies: http://kb.mozillazine.org/Security_Policies Here you can block javascript on an url or even function-level

like image 132
xxx Avatar answered Oct 15 '22 11:10

xxx


Go to your hosts file C:\Windows\System32\drivers\etc (Windows) or /etc/hosts (Linux).

Add: 127.0.0.1 ajax.googleapis.com (separated by a tab)

And reopen your browser This way the jQuery file will fail to load.

like image 33
Lourens Avatar answered Oct 15 '22 09:10

Lourens