View Full Version : Block only certain JS functions in a file
01-23-2010, 04:36 AM
This is more of a general question about blocking scripts in Firefox. Say there is that link on a website that actually brings me to the location it pretends to but when clicking it it also launches an annoying popup window (with regular window.open). Iíve spotted the responsible function in a JS file with several other functions that are useful or (unfortunately) required to use the page. Is there a way to block only that one function that is responsible for the popup with NoScript, AdBlockPlus, or Firebug, but not the entire JS file? Or is there any other application/add-on that is able to do this?
01-23-2010, 08:29 AM
01-23-2010, 01:17 PM
Yes, it’s a plain onclick event handler in the HTML that executes the function that invokes the popup.
01-23-2010, 09:29 PM
I have this greasemonkey script I created that can set each onclick for every link on the page. You can also set the include to work only the site you want it to work on
// @name Fix Links
// @include http://www.somesite.com/*
//var newurl, oldurl;
getLinks = document.getElementsByTagName('a');
for(i=0; i < getLinks.length; i++)
getLinks[i].setAttribute('onclick','your new onclick stuff here');
Powered by vBulletin® Version 4.2.2 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.