how to make winforms webbrowser control to work very similar to targeted Internet explorer

后端 未结 1 1562
情歌与酒
情歌与酒 2021-01-21 07:41

we are targeting our winforms webbrowser control to IE8 with registry key of 8000.

Below are the issues , frequently we face

  1. Script errors which are not s
1条回答
  •  迷失自我
    2021-01-21 08:26

    1. Try this code to set the FEATURE_BROWSER_EMULATION.
    2. If you have access to the web pages you're loading into WebBrowser, use X-UA-Compatible:

      
          
          ...
      
      

      You can also try IE=EmulateIE8, the difference is explained here.

    3. Once the above has been done, verify the actual document mode:

      webBrowser.DocumentCompleted += (s, e) => MessageBox.Show(
          ((dynamic)webBrowser.Document.DomDocument).documentMode.ToString());
      

    0 讨论(0)
提交回复
热议问题