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 开发者_JAVA百科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?
Several options:
Use the Addon "Adblock Plus". It will probably still accesses the js but does not execute it.
Use the Addon "Greasemonkey", which - when cofigured right - does not even touch the js-url. But its generally harder to configure right. ;)
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
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.
精彩评论