Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I have done some research and found out that it is not possible to close window/tab in Firefox if that window/tab isn't open through javascript or if the tab has history pages > 1 (i.e. Back button clickable because you browse through webpages).</p> <p>Way to do in Firefox : Delete the history first. Then you can close window without confirmation box. I haven't tried this solution. I happen to read through multiple reliable pages that describe how to do this.</p> <p><strong>Solution for Internet Explorer 6, 7, 8.</strong></p> <p>With a little help from browser detect function : <a href="http://www.quirksmode.org/js/detect.html" rel="noreferrer">http://www.quirksmode.org/js/detect.html</a> , here is how to close window without comfirmation box for multiple IE versions.</p> <pre><code>if ((userBrowser.browser == "Explorer" &amp;&amp; (userBrowser.version == "8" || userBrowser.version == "7"))) { window.open('', '_self', ''); window.close(); } else if ((userBrowser.browser == "Explorer" &amp;&amp; userBrowser.version == "6")) { window.opener = null; window.close(); } else { window.opener = ''; window.close(); // attempt to close window first, show user warning message if fails alert("To avoid data corruption/loss. Please close this window immedietly."); } </code></pre> <p>I know that some of you might think that using browser detect isn't a good idea. Also, many believe that forcing users to close window is a bad thing. I agree to those idea. But, I just need it because of software requirement we are told to do.</p> <p>Hope this helps.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload