This is an IE security feature. The idea is to prevent potentially malicious scripts in order to close a window that the user does not want to close. The exception is that the window was opened by a script in the same domain, which indicates that the web application "owns" this window, so it can also close it. In this case, you will not receive a warning.
source
share