c# - Winform WebBrowser 不显示 CSS

标签 c# html css winforms webbrowser-control

我正在尝试导航到 Flying Toasters在 Winform WebBrowser 控件中,但动画似乎卡在第一帧。我猜这是网络浏览器的兼容性问题,因为当我导航到其他网站时,它说“不再支持 IE7 和 IE8”。为什么会发生这种情况,有什么办法可以解决这个问题吗?

Frozen CSS

最佳答案

如果您不覆盖注册表中的 Feature Browser Emultate 设置,将使用 Internet Explorer 7 渲染。

对于您的用户(当前用户)仅使用此 key :

  • HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION

对于计算机/服务器上的所有用户,请使用此 key :

  • 在 64 位应用程序上的 64 位应用程序或 32 位计算机上的 32 位应用程序:

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION

  • 在 64 位机器上的 32 位应用程序上:

    HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION

例如,如果您的可执行文件名为 flying_toaster.exe。您必须添加一个名为 flying_toaster.exe 且值为 11001DWORD 条目(以使用 Internet Exlporer 11 渲染)。

enter image description here

下面列出了完整的值列表(引用自 MSDN):

11001 (0x2AF9) Internet Explorer 11. Webpages are displayed in IE11 edge mode, regardless of the !DOCTYPE directive.

11000 (0x2AF8) IE11. Webpages containing standards-based !DOCTYPE directives are displayed in IE11 edge mode. Default value for IE11.

10001 (0x2711) Internet Explorer 10. Webpages are displayed in IE10 Standards mode, regardless of the !DOCTYPE directive.

10000 (0x02710) Internet Explorer 10. Webpages containing standards-based !DOCTYPE directives are displayed in IE10 Standards mode. Default value for Internet Explorer 10.

9999 (0x270F) Windows Internet Explorer 9. Webpages are displayed in IE9 Standards mode, regardless of the !DOCTYPE directive.

9000 (0x2328) Internet Explorer 9. Webpages containing standards-based !DOCTYPE directives are displayed in IE9 mode. Default value for Internet Explorer 9. Important In Internet Explorer 10, Webpages containing standards-based !DOCTYPE directives are displayed in IE10 Standards mode.

8888 (0x22B8) Webpages are displayed in IE8 Standards mode, regardless of the !DOCTYPE directive.

8000 (0x1F40) Webpages containing standards-based !DOCTYPE directives are displayed in IE8 mode. Default value for Internet Explorer 8 Important In Internet Explorer 10, Webpages containing standards-based !DOCTYPE directives are displayed in IE10 Standards mode.

7000 (0x1B58) Webpages containing standards-based !DOCTYPE directives are displayed in IE7 Standards mode. Default value for applications hosting the WebBrowser Control.

在这篇博文中阅读更多关于 "Web Browser Control – Specifying the IE Version" 的信息

另请查看 MSDN Documentation about Feature Controls.

关于c# - Winform WebBrowser 不显示 CSS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25098375/

相关文章:

c# - "TagLib#"库发生了什么?

c# - 默认 HTTP header 是否有任何常量?

c# - 如何在我的 View 中将 C# 全局命名空间运算符与 using 指令一起使用?

javascript - Firefox box-sizing + expanding div = missing padding?

jQuery 弹出窗口滚动

javascript - 我不明白为什么我的代码没有被执行

css-float - 如何使用 css overflow hidden 的 float 元素?

javascript - 如何使图像随着 DIV 的变化而动态调整大小?

javascript - 使用 iDangerous Swiper 的连续/恒定自动播放速度

c# - 我正在使用 Clipboard.GetDataObject();但有时它不能像我需要的那样工作