本文介绍了如何让Delphi TWebbrowser组件运行在IE9模式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
由于TWebbrowser以IE7兼容模式运行,因此TWebbrowser遇到Javascript错误。有没有办法防止这种情况,只是让它运行在IE9模式下?
解决方案
- 选择加入。
- 根据您选择的浏览器仿真设置,您可能需要确保您的文档包含合适的DOCTYPE。再次,这在中有所描述。
所以,例如,如果你想做出最简单的改变,你将添加以下注册表设置:
HKEY_LOCAL_MACHINE(或HKEY_CURRENT_USER)
软件
Microsoft
Internet Explorer
主
FeatureControl
FEATURE_BROWSER_EMULATION
YourExeNameGoesHere.exe =(DWORD)00009999
价值 9999的文档
说:
还需要修改文档的DOCTYPE:
链接的文档还包括指定其他IE版本所需的信息。
I am experiencing Javascript errors with TWebbrowser due to the fact that TWebbrowser is running in IE7 compatibility mode.
Is there a way to prevent this and just have it run in IE9 mode?
解决方案
- Opt in to the browser emulation feature using the documented registry key.
- Depending on the browser emulation setting that you selected, you may need to ensure that your document contains a suitable DOCTYPE. Again, this is described in the documentation.
So, for example, if you wish to make the simplest possible change you would add the following registry setting:
HKEY_LOCAL_MACHINE (or HKEY_CURRENT_USER) SOFTWARE Microsoft Internet Explorer Main FeatureControl FEATURE_BROWSER_EMULATION YourExeNameGoesHere.exe = (DWORD) 00009999
The documentation for the value 9999
says:
Were you to use 9000
then you'd need also to modify the DOCTYPE of your document:
The linked documentation also includes the information required to specify other IE versions.
这篇关于如何让Delphi TWebbrowser组件运行在IE9模式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!