none
IE9 WebBrowser control and userAgent string in IE7, IE8 and IE9 mode with Internet Explorer 9 beta.

    Question

  • Operating System:Windows 7   Version:Internet Explorer 9 Beta
    Q 1:
    With IE8, you could add to the userAgent see http://msdn.microsoft.com/en-us/library/ms537503(v=VS.85).aspx?ppud=4  (In IE7 or IE8 mode)
    With IE9 beta (9.0.7930.16406) This works in IE7, IE8 or IE9 mode when using the Internet Explorer 9 window.
    If you use the WebBrowser control in your own project this only works in IE7 mode.
    Is there some regestry value that needs to be added or edited to display the full userAgent string.
    IE8/IE9 mode returns:
    Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)
    and not the full userAgent string: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0; ...; ...; MyApp) 

    At http://blogs.msdn.com/b/ie/archive/2010/03/23/introducing-ie9-s-user-agent-string.aspx you say

    IE9 will send the short UA string by default

    so how do you display the long string.

    Q 2:

    Also should HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION
    be 9888 or 9999 for IE9 mode on all pages or is there no such mode.

    Q 3:

    I have also noticed another problem with the userAgent string.

    In IE 7 mode (7000)
    !--[if IE 7] is true
    userAgent = Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/5.0; ..

    In IE 9 mode (9000)
    !--[if IE 9] is true
    userAgent = Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)


    But in IE 8 mode (8000 and 8888)
    !--[if IE 9] is true
    userAgent = Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)
    The MSIE is 9.0 and not 8.0

    Saturday, September 25, 2010 2:31 AM

Answers

  • Sorry Mark... I misread your question... you are in the wrong forum (this is web development) and

    IE9 is Beta and

    shdocvw.webbrowser is the ActiveX control for the web browser control... I don't think that it has been updated yet for changes with the IE9 beta ieframe.dll

    anyway, you use settings in the registry to change the default rendering mode for the WB control...

    http://msdn.microsoft.com/en-us/library/ms537184(VS.85).aspx

    I doubt if IE9 rendering mode (whatever that means, <wink>) is supported yet... It is the first beta release...

    There are some js shims about that enable you to render some of the new HTML5 features in IE8 or earlier. The Adobe SVG document ActiveX control supports SVG in earlier IE versions.

    If you feed a valid html5 document to any web browser it will use the most 'standards compliant mode' that it is capable of supporting to render it...

    Thus feeding html5 to a web browser control with no featurecontrol over-ride will use near standards IE7 Emulation. You need to add the html5 js shim to your page for the WB to render some of the new HTML5 elements in a !doctype html page.

    It will use the MSIE 7 UAS token and recognise only <!--[if lte IE 7] conditional comments.

    If you have the featurecontrol EmulateIE8 over-ride it will use the IE8 'standards' rendering engine by default.... you still have to add the html5 shims to your web pages. It will use the MSIE 8 UAS token and recognise <!--[if lte IE 8] conditional comments.

    So far I don't think there is a EmulateIE9 featurecontrol over-ride (I could be wrong... haven't digested all of the developer release notes for IE9 BETA)... It is BETA after all.

    If you are using an <object tag with the WB CLSID (like the IETabs extension for FX and Chrome) then you are stuck with the IE7 rendering engine because it has no executable to map the featurecontrol over-rides to. You can still render SVG and HTML5 content in it with the SVG ActiveX controls or the html5 shims.

    FX have flagged the IETab extension as incompatible with FX 3x, although I still use it. It has serious security concerns because it does not use the IE Security model, it sends the MSIE 7 UAS token and uses the EmulateIE7 rendering.

    For all these reasons it is important that your html5 web pages use feature detection instead of browser sniffing (UAS sniffing) to detect browser capabilities.

    shdocvw.dll is dated 4/11/2009 on my system where I have IE9 Beta installed.

    My IEAddons can't access any InternetExplorer collections, but the Internet Explorer_Server collections are still accessible from my COM Addons. Its no longer Kansas Toto.

    You are trying to hit a moving target Mike... It is the first Beta.

    You can get help with IE Extension Development at the IE Extension Development forum

    http://social.msdn.microsoft.com/Forums/en-US/ieextensiondevelopment/threads


    Rob^_^
    Saturday, September 25, 2010 5:21 AM

All replies

  • F12, Browser Mode, Not Document Mode to toggle the IE version vector.

    From the developer tool go Tools>Change User Agent string, regardless of the documents' default DocumentMode.

    ?document.documentMode

    ?document.doctype (if documentMode==9)

    ?navigator.userAgent

    ?navigator.appVersion

    The IE version vector is not explosed to javascript. IE conditional comments only work in MSIE browsers.

    The recommedations are that you don't use UAS sniffing and use feature detection instead. See the last 20 posts on the IE Blog.


    Rob^_^
    Saturday, September 25, 2010 2:46 AM
  • Sorry I'm using the Internet Explorer WebBrowser control, so F12 could do anything I program it to do.
    F12 in Internet Explorer 9 just loads some Web page source editor.

    Changing 'Tools - Change User Agent string' with this text editor has no effect on my application or Internet Explorer 9.
    What is the address of your 'IE Blog'. Do you mean page 6219 of this blog!

    "The IE version vector is not explosed to javascript"?
    I'm using Javascript to read navigator.userAgent on the web pages.
    With this string the page can check the information and then load a different page.

    SCRIPT
    if(navigator.userAgent.indexOf("MyApp ")>0) {...}

    /SCRIPT

    Saturday, September 25, 2010 3:45 AM
  • Sorry Mark... I misread your question... you are in the wrong forum (this is web development) and

    IE9 is Beta and

    shdocvw.webbrowser is the ActiveX control for the web browser control... I don't think that it has been updated yet for changes with the IE9 beta ieframe.dll

    anyway, you use settings in the registry to change the default rendering mode for the WB control...

    http://msdn.microsoft.com/en-us/library/ms537184(VS.85).aspx

    I doubt if IE9 rendering mode (whatever that means, <wink>) is supported yet... It is the first beta release...

    There are some js shims about that enable you to render some of the new HTML5 features in IE8 or earlier. The Adobe SVG document ActiveX control supports SVG in earlier IE versions.

    If you feed a valid html5 document to any web browser it will use the most 'standards compliant mode' that it is capable of supporting to render it...

    Thus feeding html5 to a web browser control with no featurecontrol over-ride will use near standards IE7 Emulation. You need to add the html5 js shim to your page for the WB to render some of the new HTML5 elements in a !doctype html page.

    It will use the MSIE 7 UAS token and recognise only <!--[if lte IE 7] conditional comments.

    If you have the featurecontrol EmulateIE8 over-ride it will use the IE8 'standards' rendering engine by default.... you still have to add the html5 shims to your web pages. It will use the MSIE 8 UAS token and recognise <!--[if lte IE 8] conditional comments.

    So far I don't think there is a EmulateIE9 featurecontrol over-ride (I could be wrong... haven't digested all of the developer release notes for IE9 BETA)... It is BETA after all.

    If you are using an <object tag with the WB CLSID (like the IETabs extension for FX and Chrome) then you are stuck with the IE7 rendering engine because it has no executable to map the featurecontrol over-rides to. You can still render SVG and HTML5 content in it with the SVG ActiveX controls or the html5 shims.

    FX have flagged the IETab extension as incompatible with FX 3x, although I still use it. It has serious security concerns because it does not use the IE Security model, it sends the MSIE 7 UAS token and uses the EmulateIE7 rendering.

    For all these reasons it is important that your html5 web pages use feature detection instead of browser sniffing (UAS sniffing) to detect browser capabilities.

    shdocvw.dll is dated 4/11/2009 on my system where I have IE9 Beta installed.

    My IEAddons can't access any InternetExplorer collections, but the Internet Explorer_Server collections are still accessible from my COM Addons. Its no longer Kansas Toto.

    You are trying to hit a moving target Mike... It is the first Beta.

    You can get help with IE Extension Development at the IE Extension Development forum

    http://social.msdn.microsoft.com/Forums/en-US/ieextensiondevelopment/threads


    Rob^_^
    Saturday, September 25, 2010 5:21 AM