簡體   English   中英

WebBrowser上的HTML5的運行速度比IE或其他瀏覽器慢

[英]HTML5 on WebBrowser works slower than IE or other browser

我需要顯示WinForm的HTML5頁面,並在模式仿真IE10中使用組件Webbrowser。

當我在Webbrowser中打開任何硬頁時,我看到它的工作速度比IE或其他瀏覽器慢。

例如

        Uri uri = new Uri("http://createjs.com/demos/easeljs/Cache.html");
        webBrowser.Url = uri;             
        webBrowser.Navigate(uri);

http://createjs.com/demos/easeljs/Cache.html頁面上,如果在IE10> 60中設置了“啟用緩存” fps,但Webbrowser僅顯示15 fps

WebBrowser的注冊表模式仿真IE10

 private static void Emulation() // IE10
        {
            try
            {
                string keyName = @"SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION";
                string valueName = System.AppDomain.CurrentDomain.FriendlyName;
                RegistryKey key = Registry.LocalMachine.OpenSubKey(keyName, false);
                object FindKey = Registry.GetValue("HKEY_LOCAL_MACHINE\\"+ keyName,System.AppDomain.CurrentDomain.FriendlyName,null);
                if (FindKey == null)
                {
                    RegistryKey RegistryKey = Registry.LocalMachine.CreateSubKey(keyName);
                    RegistryKey.SetValue(System.AppDomain.CurrentDomain.FriendlyName, 10001, RegistryValueKind.DWord);
                }
            }
            catch (Exception Ex)
            {
                Console.WriteLine("Registry update error: " + Ex.Message);
                Console.WriteLine("Can't change browser version.");
            }
        }

有什么建議如何在WinForm上提高WebBrowser的性能?

使用其他默認瀏覽器怎么辦?

https://cefsharp.github.io/

Cefsharp是Chromium到.NET的端口! 您可以使用它代替IE ...

或者您可以這樣:

http://www.awesomium.com/#download

Awesomium是一個HTML引擎...

您必須在注冊表中設置以使用最新的IE版本或Edge。 否則,將使用最早的IE7。 在Webbrowser控件中使用Internet Explorer的最新版本

當我將IE從10版本更新到11版本時,組件WebBrowser中的性能提高到了正常值。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM