I use Javascript code
if( (Android|webOS|iPhone|iPad|iPod|BlackBerry).test(navigator.userAgent) ) {}
for mobile device detection, but Chrome at iOS is not detected. Is there a way to detect it? Thanks.
As you might have heard, Google Chrome is now available for the iPhone and iPad, but before you get too excited, you need to realize that it isn't Chrome at all. It's Apple's Safari with a 'chrome' interface. The actual browser, the rendering, and javascript engine is 100% Apple Safari.
You can do a Control-F search on an iPhone's browser by using the "On This Page," "Find in Page," or Share features. Control-F is a computer shortcut that locates specific words or phrases on a webpage or document. You can search for specific words or phrases in Safari, Google Chrome, and Messages.
# Chrome for iOS The UA in Chrome for iOS is the same as the Mobile Safari user agent, with CriOS/<ChromeRevision> instead of Version/<VersionNum> .
According to Google Developers, the UA string looks like this:
Mozilla/5.0 (iPhone; U; CPU iPhone OS 5_1_1 like Mac OS X; en) AppleWebKit/534.46.0 (KHTML, like Gecko) CriOS/19.0.1084.60 Mobile/9B206 Safari/7534.48.3
Where it differs from iOS Safari in that it says CriOS
instead of Version
. So this:
if(navigator.userAgent.match('CriOS'))
Should do it.
if you want simple true/false answer:
if(/CriOS/i.test(navigator.userAgent) &&
/iphone|ipod|ipad/i.test(navigator.userAgent)){
return true;
}else{
return false;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With