javascript - Disallow window.opener from child window -


i'm opening popup page code this:

var w = window.open(url, "_self"); w.opener = null; 

or this:

var anchor = document.createelement("a");   anchor.target = "_blank";   anchor.href = url;   var evt = document.createevent("mouseevents");   evt.initmouseevent("click", true, true, window, 0, 0, 0, 0, 0, true, false, false, true, 0, null); anchor.dispatchevent(evt); 

this works fine, problem document loaded in popup window has permission change location of opener window. works when document in popup different domain. has no permission read location allowed change location. don't want that. want popup disconnected main page.

window.opener.parent.location.href="http://example.com"; in child window change parent window url

is there trick can use break connection between opener window , opened window? ideally opened window should not know opened other window @ all.


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -