Will the IE9 WebBrowser Control Support all of IE9's features, including SVG?

前端 未结 12 1407
后悔当初
后悔当初 2020-11-22 06:34

I recently upgraded to IE9-beta. Now, In my .Net (3.5) WinForm application I want to use WebBrowser control.

So my question is, whether the WebBr

相关标签:
12条回答
  • 2020-11-22 06:35

    Yes, WebBrowser control uses whatever version of IE you have installed. This means of course that if you run your application on a machine with IE 8 then the IE 9 features you depend on will not be available.

    0 讨论(0)
  • 2020-11-22 06:35

    I liked the (C#) code in the following which sets the registry settings for your app. Not sure if it will cut it after installation though if permissions are required. For me it solved an issue with WebSocket not being available inside a WebBrowser control in WPF.

    C# webbrowser Ajax call

    0 讨论(0)
  • 2020-11-22 06:36

    I know this thread is old and there are already comprehensive answers.

    Just in case you don't know this:

    <meta http-equiv="X-UA-Compatible" content="IE=edge" >

    You don't have to hardcode IE version number as

    <meta http-equiv="X-UA-Compatible" content="IE=9" >

    0 讨论(0)
  • 2020-11-22 06:41

    I had the same problem, and the registry answers here didn't work.

    I had a browser control in new version of my program that worked fine on XP, failed in Windows 7 (64 bit). The old version worked on both XP and Windows 7.

    The webpage displayed in the browser uses some strange plugin for showing old SVG maps (I think its a Java applet).

    Turns out the problem is related to DEP protection in Windows 7.

    Old versions of dotnet 2 didn't set the DEP required flag in the exe, but from dotnet 2, SP 1 onwards it did (yep, the compiling behaviour and hence runtime behaviour of exe changed depending on which machine you compiled on, nice ...).

    It is documented on a MSDN blog NXCOMPAT and the C# compiler. To quote : This will undoubtedly surprise a few developers...download a framework service pack, recompile, run your app, and you're now getting IP_ON_HEAP exceptions.

    Adding the following to the post build in Visual Studio, turns DEP off for the exe, and everything works as expected:

    all "$(DevEnvDir)..\tools\vsvars32.bat"
    editbin.exe /NXCOMPAT:NO "$(TargetPath)"
    
    • Editbin documentation
    • Dumpbin /headers will display the DEP setting on a exe.
    0 讨论(0)
  • 2020-11-22 06:44

    Thank goodness I found this. The following is extremely important:

    <meta http-equiv="X-UA-Compatible" content="IE=9" >
    

    Without this, none of the reports I'd been generating would work post IE9 install despite having worked great in IE8. They would show up properly in a web browser control, but there would be missing letters, jacked up white space, etc, when I called .Print(). They were just basic HTML that should be capable of being rendered even in Mosaic. heh Not sure why the IE7 compatibility mode was going haywire. Notably, you could .Print() the same page 5 times and have it be missing different letters each time. It would even carry over into PDF output, so it's definitely the browser.

    0 讨论(0)
  • 2020-11-22 06:47

    The IE9 "version" of the WebBrowser control, like the IE8 version, is actually several browsers in one. Unlike the IE8 version, you do have a little more control over the rendering mode inside the page by changing the doctype. Of course, to change the browser mode you have to set your registry like the earlier answer. Here is a reg file fragment for FEATURE_BROWSER_EMULATION:

    Windows Registry Editor Version 5.00
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION]
    "contoso.exe"=dword:00002328
    

    Here is the complete set of codes:

    • 9999 (0x270F) - 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.
    • 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.
    • 7000 (0x1B58) - Webpages containing standards-based !DOCTYPE directives are displayed in IE7 Standards mode.

    The full docs:

    http://msdn.microsoft.com/en-us/library/ee330730%28VS.85%29.aspx#browser_emulation

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