Remove parentage form child window

 ̄綄美尐妖づ 提交于 2019-12-06 05:19:16

The opener property is what gives access to the child window, so if you want to disconnect it all you have to do is set it to null. When doing this, I always copy it to another property before nullifying in case you need it for other reasons...

if(bustInheritance) {
  window.oldOpener = window.opener;
  window.opener = null;
}

Hacky, but might do the trick:

var win_onload = window.onload;
// replace it with a function that does nothing
window.onload = function () { };

... open your window ...

// put the event handler back
wndow.onload = win_onload;
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!