IE prevents Window.close()

NetRock6
NetRock6 used Ask the Experts™
on
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.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
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
Chinmay PatelChief Technology Ninja
Distinguished Expert 2018

Commented:
Hi NetRock6,

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

Regards,
Chinmay.
Should you be charging more for IT Services?

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Zakaria AcharkiAnalyst Developer
Distinguished Expert 2018

Commented:

Commented:
Nothing to do by changing the settings.
Use this:
function quitBox(cmd)
{  
    if (cmd=='quit')
    {
        open(location, '_self').close();
    }  
    return false;  
}
Sam JacobsDirector of Technology Development, IPM

Commented:
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

Author

Commented:
Thank you All for your help.

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

Thanks.
Director of Technology Development, IPM
Commented:
It works for an .hta as well ... please see attached (remove the .txt extension).
test.hta.txt

Commented:
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.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial