Can JavaScript Close This Window?
Can JavaScript Close This Window? How to Tell if the Current Window (or Tab) was Opened From JavaScript One of the rules on how JavaScript interacts with the web browser window is that JavaScript is only allowed to close a browser window if that window was opened by JavaScript. If the particular browser window was already opened by your visitor before they can to your site then you are not allowed to close their browser window. The only browser that disregards this rule and will allow a browser to close a window that it didn’t open is Internet Explorer. Even that browser doesn’t just allow your JavaScript to close web browsers indiscriminantly though. If the browser window you are trying to close in IE is not one that your JavaScript opened then your visitor will see a confirmation dialog asking them to confirm if they will allow your script to close their browser. If they deny the request then their browser window stays open exactly the same as happens with all browsers except for Int