title: window.open no longer works when called in the onunload event handler in IE9
body: <p>In my web application, I launch a desktop application using a custom url protocol.  For example: "fakeproto://" will launch "fakeproto.exe" on your desktop.  If you don't know what I'm talking about, read this: <a href="http://msdn.microsoft.com/en-us/library/aa767914%28v=vs.85%29.aspx" rel="nofollow">Registering an Application to a URL Protocol</a></p>
  
  <p>I needed a way, though, to make sure "fakeproto.exe" was installed on the user's PC before attempting to launch.  It's a bit of a hack, but I got it to work for all the major browsers.  IE presented the most problems and had a unique implementation.</p>
  
  <p>In Javascript, I would first try to load the custom url protocol:</p>
  
  <pre><code>window.open('fakeproto://', '_self');
  </code></pre>
  
  <p>Before this, I actually defined the following onunload event handler:</p>
  
  <pre><code>window.onunload = function()
  {
       window.open('help.php', '_self');
  }
  </code></pre>
  
  <p>So if the desktop didn't recognize the custom url protocol, IE would simply leave the current page and go to "webpage cannot be displayed".  In this event, the onunload event handler would fire and open help.php instead.</p>
  
  <p>This works great in IE7 &amp; IE8, but once I upgraded to IE9, this no longer works?  It goes to "webpage cannot be displayed" instead of help.php.</p>
  
  <p>Using a debugger, the onunload event handler is firing and the code is being executed correctly, but for some reason the window.open call isn't working???  I disabled the pop-up blocker as well, to make sure it wasn't that.  No luck.</p>
  
  <p>Anyone have any ideas?  Anyone hear of IE9 being more strict with window.open?  Anyone know of any alternative solutions to the original problem?</p>
  
  <p>BTW, I can get it to work if I open help.php to a new window.</p>
  
  <pre><code>window.onunload = function()
  {
       window.open('help.php', '_blank');
  }
  </code></pre>
  
  <p>But this only works if any pop-up blockers are disabled.  I would like to avoid using this solution.</p>