This works if the location of the newly opened window is same-origin:
var w = window.open("https://stackoverflow.com/questions/1372022/child.html")
w.addEventListener('load', w.doSomething, true);
This works if the location of the newly opened window is same-origin:
var w = window.open("https://stackoverflow.com/questions/1372022/child.html")
w.addEventListener('load', w.doSomething, true);