Post date: Apr 6, 2015 1:53:14 PM
Handy tool to block most popups but you probably should use the default pop up blocker that comes with your browser or as a plugin. Although almost all popup blockers apply a similar method.
This code simply changes the default window.open function so that you can do whatever you want with it.
javascript:(function(){window.open=function(){return false}})()
A few tweaks to the code and you could set it up to report the url instead of opening a new window if you would be interested in that kind of information.
javascript:(function(){window.open=function(url,name,specs,replace){alert('url:'+url);return false}})()
To re-enable all you have to do is delete the window.open function and it will be restored.
javascript:(function(){delete window.open})()
Smart popup creators delete the window.open before they call the window.open function to counter this (hack).