Menu

#1097 Problems with opened window's dynamic properties

2.7
open
nobody
None
5
2012-10-21
2010-05-25
Anonymous
No

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.

Discussion

  • Anonymous

    Anonymous - 2010-05-25

    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?

     

Log in to post a comment.