Link to home
Start Free TrialLog in
Avatar of NetRock6
NetRock6Flag for Canada

asked on

IE prevents Window.close()

Hi ..
After running a script the below IE11 pops out the below message:
The web page you are viewing is trying to close the window. Do you want to close this window? Yes|No
I tried different settings in the security tab like:
"Display Mixed Content"
"unchecked "Enable protected mode"
But none help so far. Does anyone know what option i need to change to prevent the popup.
Your Quick Prompts Highly Appreciated.

Thanks.
Avatar of ITguy565
ITguy565
Flag of United States of America image

Internet options - Security - Trusted sites - Sites
Uncheck Require server verification (https:) for all sites in this zone
Adding http://*.live.com fixed my problem.


Change http://*.live.com to problem domain in question.


reference : https://answers.microsoft.com/en-us/ie/forum/ie9-windows_7/ie9-how-do-i-disable-the-ie-popup-the-webpage-you/0451d034-90d7-4de9-8757-a00b24e55b82?page=2
Hi NetRock6,

Your script didn't make it. Please update the question with it.

Regards,
Chinmay.
Nothing to do by changing the settings.
Use this:
function quitBox(cmd)
{  
    if (cmd=='quit')
    {
        open(location, '_self').close();
    }  
    return false;  
}
The attached works for IE and Edge (but not Firefox and Chrome).
If you have other code that works for those browsers, maybe you can do a browser sniff and branch as needed.
closeWindow.html
Avatar of NetRock6

ASKER

Thank you All for your help.

@Sam;
That is a great workaround. How does it work in a hta script 'window.close()'.

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of Sam Jacobs
Sam Jacobs
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Even is basically the same as mine, it's work well.The idea is to load self and close it. Another is to first empty the inner and next close,because an empty element are not throwing the page protection routine.