The IWebBrowser2 object uses the version of IE7, not the version of IE installed on the machine

I am developing on a Win7 machine with IE8 browser (the same thing happens with IE9).

I created an application with an IWebBrowser2 object embedded in its own window.
Inside this browser object, I execute javascipt code:

var txt = "Browser Name: " + navigator.appName + "\n"; txt += "Browser Version: " + navigator.appVersion + "\n"; alert(txt); 

and I get the following warning: enter image description here

This confirmed my previous fears - even when IE8 \ IE9 is installed on my machine - the IWebBrowser2 object behaves as if it were IE7 (including all the annoying HTML \ CSS behaviors).

Does anyone know why this is? or better - if it is possible to embed a browser object in IE8 \ IE9 (for distribution - therefore, it must be legal)

Thanks,

+6
source share
1 answer

IE7 is the default rendering mode for built-in IE controls (for compatibility reasons). Use FEATURE_BROWSER_EMULATION to change this.

Read the Plip answer here or IEBlog to get an idea of ​​how to do this.

+10
source

Source: https://habr.com/ru/post/894118/


All Articles