I have a site where I want to prevent the page from reloading using a document.location in a script tag. How can I do this in Firefox?
|
The GreaseMonkey add-on for Firefox is designed to do exactly that. |
|||||||
|
|
Actually, Greasemonkey will not block if the HTML code contains an inline javascript block with a redirect like so:
Greasemonkey, however can be used to block calls to specific functions -- just overwrite them :). If the above were wrapped into a function call like so:
Then you could just redefine the function in Greasemonkey:
Block inline redirects via Firefox Essentially Firefox makes it possible to block any DOM manipulation like A word of warning: Note that your security settings will then block ALL calls from that domain for Setting up CAPS to block location.href.replace You do not need Greasemonkey for this task. Firefox comes with a built-in capability for allowing/disallowing access to properties/methods of DOM Objects on a per-site basis. It is called Configurable Security Policies (CAPS) and it is described in 1. A short guide assuming the simplest case:
Of course, you will have to replace the domain with the one you want to prevent from redirecting your frames. Find a more thorough explanation from my blog (justaddwater.dk): Firefox Tip For Framebuster JavaScript. |
|||
|
|
|
Try the YesScript extention. YesScript lets you make a blacklist of sites that aren't allowed to run JavaScript. |
||||
|
|