Feedback on: irt.org FAQ Knowledge Base Q214
Worth:
Worth reading
Length:
Too short
Technical:
Not technical enough
Comments:
Yeah, but how global is this? It obviously doesn't work after the page containing it is replaced by a new page that contains JavaScript, even if that page merely calls open() without defining it. Neither MSIE nor NN provide any documentation on how to configure their browsers to disable this potentially abusive feature of the JS interpreter, and the only solutions I've found in a search expect me to purchase and rely on software written by someone else.
Worth:
Worth reading
Length:
Too short
Technical:
Not technical enough
Comments:
This does not really address the issue: if I owned the frame which opened the popup, it would work (but then I would probably just change the script to remove the open()). The issue is this: I have a frameset which embeds a document from some other site (over which I have no control) and I want to avoid that site from opening popups for my users: I own the top frame set and a bottom frame, but not the other frame... is there anyway to prevent the other frame from showing a popup?
Comments:
You can write a recursive function to navigate DOM and set the onload & onunload handlers, assuming you are coming from the same domain (in frames).
function kill(p_win) {
p_win.onload = null;
p_win.document.onload = null;
if (p_win.frames) { kill(window.top); // remove all handlers (onload & onunload) use a different name than kill, of course
for (var i = 0; i