Alex Rivera | Logout

Detecting Current Internet Explorer Security Zone

Asked 2009-03-09T10:43:09.917
9

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.

Edit
Report

1 Answer

1

The security zone doesn't matter, because windows users can determine themselves which protocols are handled by which zone. E.g., I added the entire http and the entire https zone to the trusted sites zone (zone 2). This is done through the key

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet     Settings\ZoneMap\ProtocolDefaults

You can check for the document.protocol through javascript, but how is this going to help you?

if (document.protocol == "HTTP (HyperText Transfer-Protokoll)")

You assume it's internet zone, but on my computer it's the trusted zone complete with its own individual security settings. It sux that jscript won't allow you to get the individual security setting values for each zone.

It is possible to execute activex objects without that stupid yellow bar, but you need to add the com objects guids to the list of safe com objects. This is done through the registry. Default is unsafe for most objects with the exception of some stupid useless crap objects like flash activex, wmp activex and stuff

answered 2010-01-14T18:28:49.343

Your Answer