Create an Account
username: password:
 
  MemeStreams Logo

MemeStreams Discussion

search


This page contains all of the posts and discussion on MemeStreams referencing the following web page: Unconditionally closing the browser with IE. You can find discussions on MemeStreams as you surf the web, even if you aren't a MemeStreams member, using the Threads Bookmarklet.

Unconditionally closing the browser with IE
by Acidus at 1:27 pm EDT, May 14, 2007

Closing Windows and Confirmation Boxes
Ever notice how a script that attempts to close a window will at times generate a confirmation and other times not?

Here's why: IE for windows and NN 4.x browsers do not allow a non-JavaScript-generated window with more than one page in its history to be closed without asking the user for permission via a confirmation box. In other words, scripts cannot close a main window unconditionally.

The MSIE Work Around
To determine whether or not a window is a main window, Internet Explorer checks to see if the window has an opener. Since windows that have openers can be closed unconditionally, the solution is to make Explorer think a main window has an opener. That is accomplished by giving a phantom opener a value, in this case, an empty string:

Something I didn't even know to go looking for before I read the IE7 release notes.


 
 
Powered By Industrial Memetics