How to force a IE version in a Winform WebControl?

岁酱吖の 提交于 2019-12-07 14:39:44

问题


I was trying to find out the problem in one web design I had and remembered to use a simple javascript to get the browser version as I had completly 2 different behaviors

so I add this:

<div id="example"></div>

<script type="text/javascript">

txt = "<p>Browser CodeName: " + navigator.appCodeName + "</p>";
txt+= "<p>Browser Name: " + navigator.appName + "</p>";
txt+= "<p>Browser Version: " + navigator.appVersion + "</p>";
txt+= "<p>Cookies Enabled: " + navigator.cookieEnabled + "</p>";
txt+= "<p>Platform: " + navigator.platform + "</p>";
txt+= "<p>User-agent header: " + navigator.userAgent + "</p>";

document.getElementById("example").innerHTML=txt;

</script>

and found out this:

original image

even though I have Internet Explorer 8 installed on this machine, the webbrowser control loads a version of IE (Internet Explorer 7) that is not the one installed.

How can I force using the correct version?


回答1:


Actually it is possible to force the control to use particular version of IE. Have a look at this article: Witch version of browser is used by the WebBrowser control?




回答2:


I don't think it's possible to do that. One option is to embed WebKit into your app: http://sourceforge.net/projects/webkitdotnet/

This will make your install a lot bigger, but at least you'll have embedded a competent browser. :)



来源:https://stackoverflow.com/questions/4931667/how-to-force-a-ie-version-in-a-winform-webcontrol

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!