On an android device running the stock browser (not the chrome one), Browser.safari equals true.
I expected the Browser.name to be 'unknown' because is not Safari that its running there.
Also Chrome was released for both Android and iOS but Browser.name reports 'unknown' when running in iOS.
This is because the user agent contains CriOS/XXX instead of Chrome/XXX.
Hope this gets fixed into the core.
After taking a look at the Browser code, as a fallback if Safari is contained in the string then mootools assumes it is safari.
Is this intended?
Chrome on iOS is basically safari in a webview...
@arian if one uses the Browser to make some browser usage statistics it will report the wrong browser. Thats just one example.
Ups, closed and reopened by mistake.
For statistics you should save the raw data.
Usually Browser.stuff is used to show certain features or not. Like hide an input[type="file"] on iOS because it won't do anything, but will in Android.
I think changing the UA string to CriOS is done on purpose so it doesn't match chrome, because it's not actual Chrome, but safari, so maybe that should return safari.
For the stock android browser safari makes sense as well, because it's webkit and Browser.platform.Android is true for Android. Browser.Platform.ios for iOS.
Anyway, I don't think we should change too much, using Browser isn't usually a good idea anyway.
I think that if one is targeting the engine, its wrong to check for safari, they should check for webkit instead. Thats why other libraries such as YUI and Dojo offers .webkit, .gecko checks, etc..
I just opened this issue because for me, the Browser name is different than the Browser engine and mootools offers only Browser name checks, and is currently failing (maybe on purpose) to deliver the correct browser name to the final developer.