Forum Moderators: open
What I would of loved to see it use a default User-Agent like the following instead.
"Chrome/0.2.149.27 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.13"But with an option to switch to the other User-Agent like how Opera allows. But I am guessing they wanted to start off with as many sites being able to determine basic browser capabilities off the bat based off old hacks like "(KHTML, like Gecko)" for really old sites that check for Gecko or KHTML, and included Safari for the newer sites.
It is the same complaint that is made about Internet Explorer hiding behind the Mozilla/4.0 compatible UA Stuff.
So what is everyone else's thoughts on the mater?
[edited by: Ocean10000 at 2:45 am (utc) on Sep. 3, 2008]
I have an analysis module on my production site that tracks usage, and I just added Chrome to the mix.
Here's the Chrome UA I used for testing, via the 'User Agent Switcher' add-on in Firefox:
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.2.149.27 Safari/525.13
And, here's the PHP code I used for detection:
// Google Chrome - VinDSL (24-Sep-2008)
if( preg_match("/Chrome\/([0-9\.]{1,10})/i", $agent, $found ) ) $browser = "Google Chrome " . $found[ 1 ]
Seems to work well!
It was harder finding the official Google Chrome logo (which looks like a Pokéball) than detecting the browser itself.
If scrapers, crawlers, yada, yada, yada, start abusing the UA, it should be a simple matter to come up with a suitable regex and add them to a 'robots array' constructor!
[edited by: VinDSL at 6:30 pm (utc) on Sep. 25, 2008]