Customizing (disabling) security settings for IE c

2019-09-11 07:42发布

问题:

I have a job that takes screen shot of a website on a given URL. IE control is instantiated inside the job (which is a console app). However the pages are not rendered correctly the security settings of the server on which the job is running. I found in some answers taht security settings can be controlled by IInternetSecurityManager.

I created a class that inherits from WebBrowser class and implements this interface and a couple of others similarly to the way it is done here. But this didn't solve my problem. Does this interface requires some activation or a special call in order to influence the behavior of the control.

Shortly I need somehow to customize security settings for the IE control.

回答1:

IE Enhanced Security Configuration is not something that can be disabled in code as far as I know. I think it can only be disabled on the server or via Group Policy.

It is designed to be an ultra-restricted environment for web browsers running on servers, and it is enabled for all users by default IIRC.

Your choices are: disable it on the server (or via group policy), or add the target site to the list of trusted sites in IE. I think a trusted site works normally, even under IE ESC.