能够在 WPF 网络浏览器中支持 Html5

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/21522730/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-13 10:42:00  来源:igfitidea点击:

Ability to support Html5 in WPF webbrowser

c#wpfhtmlbrowser

提问by proah

My WPF browser does not support html5 elements on webpages, and I do not know how to implement support for it. I do have IE9 installed and I can see html5 elements browsing with IE.

我的 WPF 浏览器不支持网页上的 html5 元素,我不知道如何实现对它的支持。我确实安装了 IE9,并且可以看到使用 IE 浏览的 html5 元素。

Any help with how I can go about adding support for html5 is very much appreciated.

非常感谢我对如何添加对 html5 的支持的任何帮助。

回答by proah

I actually found out the solution by myself. Everything is explained on this page: http://kirubhananth.blogspot.se/2013/04/how-to-load-html-5-content-in-wpf.html

我实际上自己找到了解决方案。一切都在此页面上进行了解释:http: //kirubhananth.blogspot.se/2013/04/how-to-load-html-5-content-in-wpf.html

  1. Click Start -> Run (or Win+Rshortcut)
  2. Type REGEDITin the textbox and click enter. The Registry Editor will be opened. Needs administration rights to open and modify the registry.
  3. Traverse in the tree in left side panel through HKEY_LOCAL_MACHINE -> SOFTWARE -> Wow6432Node -> Microsoft -> Internet Explorer -> MAIN -> FeatureControl -> FEATURE_BROWSER_EMULATION
  4. After selecting the FEATURE_BROWSER_EMULATIONright click the empty space in the right side keys panel and select New -> DWORD (32 bit) Value
  5. Set the value name as your app's name. eg: MyApp.exe
  6. Set the vaule data to 270f and tick Hexadecimal.
  7. To support debugging through Visual Studio, add another key with the same value data and with .vshostbetween your app name and the extension. eg: MyApp.vshost.exe
  1. 单击开始 -> 运行(或Win+R快捷方式)
  2. REGEDIT在文本框中键入,然后单击 Enter。将打开注册表编辑器。需要管理权限才能打开和修改注册表。
  3. 在左侧面板中的树中遍历 HKEY_LOCAL_MACHINE -> SOFTWARE -> Wow6432Node -> Microsoft -> Internet Explorer -> MAIN -> FeatureControl -> FEATURE_BROWSER_EMULATION
  4. 选择后FEATURE_BROWSER_EMULATION右键单击右侧按键面板中的空白区域并选择New -> DWORD (32 bit) Value
  5. 将值名称设置为您的应用程序名称。例如:MyApp.exe
  6. 将 vaule 数据设置为 270f 并勾选十六进制。
  7. 要支持通过 Visual Studio 进行调试,请添加另一个具有相同值数据且.vshost在应用名称和扩展之间的键。例如:MyApp.vshost.exe