•  Phe0n1x
  • 80% (Honored)
  • YAF Lover Topic Starter
It turns out .NET itself reports it incorrectly so we must add an if statement.

Project: YAF.Classes.Utils
Context.cs (YAF.Classes.Utils.YafContext)
function InitUserAndPage()
below line 868 add

if (HttpContext.Current.Request.UserAgent.ToLower().Contains("chrome"))
    browser = "Chrome 2.0";

with surrounding code:

string browser = String.Format( "{0} {1}", HttpContext.Current.Request.Browser.Browser, HttpContext.Current.Request.Browser.Version );
if (HttpContext.Current.Request.UserAgent.ToLower().Contains("chrome"))
    browser = "Chrome 2.0";

bool isSearchEngine = false;

This should fix that annoying "AppleMAC-Safari 5.0" statement where Chrome should be.

ISSUE WITH FIX: If M$ fixes this, it will need to be changed.

  •  Jaben
  • 100% (Exalted)
  • YAF Developer

FP: Jaben.
  •  Phe0n1x
  • 80% (Honored)
  • YAF Lover Topic Starter
no problem, I posted this in the patches forum along with my other fix in order to have a topic to keep coming back to if I find any more.
Here's the info on this if anyone is curious:

The Windows 7 User-Agent String

On Windows 7, IE8 will send the User-Agent string with the new Windows NT version token.

IE8 on Windows 7

Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0)

(If you’re curious about why Windows 7 uses the version number “6.1”: the short answer is that it improves compatibility, and the longer answer can be found over on the Windows Team Blog .)

Nevertheless, the “Windows NT 6.1” version token may still result in problems for a very small number of websites that check the operating system version. Such websites may show error messages or otherwise interrupt visitors who are running Internet Explorer 8 on Windows 7. The Compatibility View button will not resolve this problem for such sites, because the Compatibility View button only changes the Internet Explorer version number, leaving the Windows version number intact.

In order for IE8 users on Windows 7 to visit websites which block the “Windows NT 6.1” version string, a registry override must be set to temporarily change the reported Windows version number. If you encounter any websites that block Windows 7 visitors, please submit a bug report on Connect or provide the URL of the site in the comments below.
KASL Technologies  - Specializing in Custom Web Application Development

About Us

The YAF.NET is an open source .NET forum project. YAF.NET is supported by an team of international developers who are build community by building community software.

Powered by Resharper Donate with PayPal button

Project Twitter Updates

Copyright © YetAnotherForum.NET & Ingo Herbote. All rights reserved