IE7 RC1 window.close() issue

We have a web application that we are currently testing with IE7 RC1 in order to be ready for the release of IE7.

We often open new browser windows using script (i.e. window.open()) but have found that whenever we attempt to close the child window using script (i.e. window.close()) we are prompted with the message "The webpage you are viewing is trying to close the tab. Do you want to close this tab?"

We do not have this issue with IE6 and have not yet been able to track down the reason for the issue in IE7 RC1.

I understand that you cannot close a browser window through script that has not been opened with script. But in our case, we are opening the child window with script. Can anybody tell me the circumstances under which this message might be displayed even when the window was opened by script?

[844 byte] By [dgracey] at [2007-12-25]
# 1

Can you supply the script that causes this?

Thanks
-Dave

DaveMassy at 2007-8-31 > top of Msdn Tech,Internet Explorer Development,Internet Explorer Web Development...
# 2

Hi Dave,

Actually, I have done some more research on my issue and have narrowed it down to loading an XML document with a linked XSL Transform (launched via script). I opened a new thread with the details...

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=781921&SiteID=1

Please let me know if you can provide some insight into this. We are desparately trying to solve this in time for the final release of IE7.

Thanks, David

dgracey at 2007-8-31 > top of Msdn Tech,Internet Explorer Development,Internet Explorer Web Development...
# 3
dgracy, did you ever get that issue resolved? Experiencing similar situation here.
GoneShootin at 2007-8-31 > top of Msdn Tech,Internet Explorer Development,Internet Explorer Web Development...
# 4

I never did find a fix for this issue so my guess is it's either a bug in IE7 or Microsoft has changed the way it handles loading XML files with the stylesheet processing instruction.

My workaround was to essentially launch an empty html page with javascript that loads the XML document and performs the XSL Transformation using the MSXML parser... then load the resultant HTML into the body (or an empty div) using the innerHTML property.

I would very much prefer to do this with my orginal method so I'm hoping this gets addressed at some point!

dgracey at 2007-8-31 > top of Msdn Tech,Internet Explorer Development,Internet Explorer Web Development...
# 5
hi guys.

not the best solution, but it gets you there in the end.

http://www.webdeveloper.com/forum/showthread.php?t=121449

note: you may need to have windows script 5.6 installed on your server.
nath at 2007-8-31 > top of Msdn Tech,Internet Explorer Development,Internet Explorer Web Development...
# 6

For an easy workaround / solution to this "window.close()" problem, please see my reply in the following post:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=962189&SiteID=1

Hope this helps,
Paul

pnarsavage at 2007-8-31 > top of Msdn Tech,Internet Explorer Development,Internet Explorer Web Development...