As we all know Google has released their own web browser called: Chrome. As a web developer when I first heard about it my first thoughts where; “oh great, another browser to check for and to load certain style sheets etc etc etc”. However, that’s not the case, Google Chrome is built off the Apple WebKit just like Safari.
The only problem I for-see with Google using WebKit is that most browser detection done via javascript is going to return Safari not Chrome!
How do we overcome this?
var is_chrome = navigator.userAgent.toLowerCase().indexOf(‘chrome’) > -1;
Chrome’s full user agent:
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