title: Script hangs on attempt to close modal dialog
body: <p>Have a problem when trying to close modal dialog in browser. The code is similar to the following one:</p>
  
  <pre><code>                1) driver.switchTo().window(1);
                  2) driver.close();
                  3) driver.switchTo().window(0);
  </code></pre>
  
  <p>The problem is that code execution hangs on line number 2. I believe that's because of browser (none web) dialog saying "The web page you are viewing is trying to close the window..." appearance. The script goes forward after I close the confirmation dialog manually. So, I wonder if somebody have any ideas about how to handle this issue. 
  I work with IE8 browser with webdriver 2.24.1.</p>