I have a HTML page with the following javascript:
if(window.opener == null){
var appWindow = window.open("http://localhost:7676/windowprops.html", "MISAppl");
appWindow.newUnknownAttr = "fancyValue";
}
document.write(window.newUnknownAttr);
When run in real browser, it opens new window with the text "fancyValue" in it. When run in HtmlUnit, the opened window has text "undefined".
The test case is attached.
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
Well, the problem seems to be due to the fact, that JavaScript in the freshly opened window is executed before the execution of window.open method is finished and only then next line
appWindow.newUnknownAttr = "fancyValue";
is executed.
And browsers seem to execute window.open "asynchronically". Can anything be done with that?