I need to inject a script into an iframe which content is on a different domain, but I keep getting script errors and exceptions because of the cross domain restrictions. (How to inject javascript into
an iframe with webbrowser control?)
After some searching, I found that there are internet feature controls which should let me do just that without any restrictions. Those are Cross Domain Capture Event and Frame Content Modification.
Internet Explorer 7 and later. By default, Internet Explorer prevents frames from being changed by windows hosted on a different domain than the one hosting the window containing the frame. This is a security measure designed to prevent malicious sites from hijacking content hosted by legitimate websites.
When enabled, the FEATURE_IE6_DEFAULT_FRAME_NAVIGATION_BEHAVIOR feature allows frame content to be modified by windows hosted by anydomain except for those listed in the Restricted zone.
The FEATURE_BLOCK_SETCAPTURE_XDOMAIN feature prevents capture events from being propagated to elements in webpages hosted on domains different than the one hosting the page containing the element that triggered the capture event.
However, even after enabling frame content modification and disabling cross domain capture event, I am still getting the same errors when attempting to modify an iframe. I also tried disabling the features FEATURE_ISOLATE_NAMED_WINDOWS and FEATURE_CROSS DOMAIN_REDIRECT_MITIGATION without any luck.
Am I missing something?