Search code examples
javascripthtmlsecurityinternet-explorerxmlhttprequest

Detecting Current Internet Explorer Security Zone


Is there any method of programmatically determining the current security zone settings for Internet Explorer?

I'd like to know when my site will have the XMLHttpRequest ActiveX control blocked due to IE security policy, but before the site actually tries to create it and thus causes the yellow bar to appear up the top (saying "To help protect your security, Internet Explorer has restricted this webpage from running scripts or ActiveX controls that could access your computer.")

Thanks.


Solution

  • Note: I can't delete an accepted answer, but you may find this answer useful.

    Original answer:

    There's no handle in JavaScript to detect the security zone being used by IE.

    In order to do what you need to do, you could check document.location and determine the security zone from that.