Overriding window.open( ) in Javascript
Sometimes you may want override the window.open( ) in Javascript. It's strange, but you really it occasionally. Here is how we can do it: var open_ = window.open; window.open = function(url, name, opts) { return open_(url, name, opts); } Then you can add your own checking / modifications right before the window is opened.