After the code
var newWindow = window.open("url");
It should immediately open another window with a "URL". What happens after the section of the page "URL". On this page you should have a document ready function that is similar to
newWindow.onload = function (newWindow) {
newWindow.console.log("...something...");
}
What could be a simple jQuery function
$( document ).ready(function() {
console.log( "ready!" );
});
source
share