none
IE User-Agent - stored where? (Registry?)

    Question

  • I have read http://msdn.microsoft.com/en-us/library/ms537503.aspx ("Understanding user-agent strings"), but something doesn't jive. Why don't my machines' Registry settings reflect the User-Agent that IE actually sets?

    Windows 7:
    ===============
    HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\User Agent: "Mozilla/4.0 (compatible; MSIE 8.0; Win32)"
    IE9 sets (as seen by Fiddler): "User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)"

    In fact I have searched the entire Windows Registry for "MSIE 9", and nothing came up.

    Windows 8:
    ===============
    HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\User Agent: "Mozilla/4.0 (compatible; MSIE 8.0; Win32)"
    IE10 sets (as seen by Fiddler): "User-Agent: Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)"

    I have searched the entire Windows Registry for "MSIE 10", and nothing came up. (Nothing relevant under HKLM, either.)


    What gives? Seems to me the actual User-Agent strings most be stored elsewhere, or maybe they are hard-coded in IE.
    Thanks
    Tuesday, March 05, 2013 5:57 PM

Answers

  • The user-agent string sent by Internet Explorer hasn’t been pulled from the
    registry as a single string since IE3 or earlier. It is instead constructed out
    of numerous pieces, some of which are documented here: http://msdn.microsoft.com/en-us/library/ms537503.aspx#UARegistry.
    Some of the tokens (e.g. MSIE 9.0) are computed at runtime but can be overridden
    by registry strings, while others cannot be overridden by the registry. Further
    complicating matters, the IE registry string is no longer a single “string” at
    all, because the various compatibility modes influence the runtime computation
    of the UA string that is sent to the server.
    Wednesday, March 06, 2013 7:30 PM

All replies

  • Hi,

    f12>Browser Mode

    apparently some websites still browser sniff.

    Regards.


    Rob^_^

    Tuesday, March 05, 2013 11:22 PM
  • The user-agent string sent by Internet Explorer hasn’t been pulled from the
    registry as a single string since IE3 or earlier. It is instead constructed out
    of numerous pieces, some of which are documented here: http://msdn.microsoft.com/en-us/library/ms537503.aspx#UARegistry.
    Some of the tokens (e.g. MSIE 9.0) are computed at runtime but can be overridden
    by registry strings, while others cannot be overridden by the registry. Further
    complicating matters, the IE registry string is no longer a single “string” at
    all, because the various compatibility modes influence the runtime computation
    of the UA string that is sent to the server.
    Wednesday, March 06, 2013 7:30 PM
  • Maybe you can help me here Eric.
    I need for a project of mine to change the user agent automatically.
    I tried to use  :
    [DllImport("urlmon.dll", CharSet = CharSet.Ansi)]
    privatestaticexternintUrlMkSetSessionOption(intdwOption,stringpBuffer,intdwBufferLength,intdwReserved);
    constintURLMON_OPTION_USERAGENT = 0x10000001;
    privatevoidChangeUserAgent()       
    {
    UrlMkSetSessionOption(URLMON_OPTION_USERAGENT, userAgent, userAgent.Length, 0);
    }

    But with no luck. the user agent string did not change.
    my goal is to do something like "UAPick add on" but automatically.

    currently I am working with IE9.

    Thanks

    Wednesday, March 20, 2013 1:36 PM