Skip to content
This repository

Browser issues with mobile devices #2400

Closed
satazor opened this Issue August 08, 2012 · 7 comments

3 participants

André Cruz Darren Waddell Arian Stolwijk
André Cruz

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.

André Cruz

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?

Arian Stolwijk
Owner

Chrome on iOS is basically safari in a webview...

André Cruz

@arian if one uses the Browser to make some browser usage statistics it will report the wrong browser. Thats just one example.

André Cruz satazor closed this August 13, 2012
André Cruz satazor reopened this August 13, 2012
André Cruz

Ups, closed and reopened by mistake.

Arian Stolwijk
Owner

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.

André Cruz

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.

Darren Waddell
Collaborator

wontfix

Darren Waddell fakedarren closed this February 20, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.