This repository has been archived by the owner. It is now read-only.

Joomla CMS [#29922] Detect Chrome for iOS in browser.php #1841

Merged
merged 1 commit into from Mar 16, 2013

Conversation

Projects
None yet
2 participants
Contributor

axelsjo commented Feb 27, 2013

Fixes tracker item:
http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_id=8103&tracker_item_id=29922

Simular (CriOS) to a previous fix for Chrome for Android (CrMo):
http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=28039

An alternative approach is to put Chrome|CrMo|CriOS in the rame regexp... I prefer to keep them apart though - some redundant code, but better readability.

Joomla CMS [#29922] Detect Chrome for iOS in browser.php
Fixes tracker item:
http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_id=8103&tracker_item_id=29922




Simular (CriOS) to a previous fix for Chrome for Android (CrMo):
http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=28039




Some might prefer to put Chrome|CrMo|CriOS in the rame regexp... I prefer to keep them apart though; some redundant code, but better readability.
Contributor

axelsjo commented Feb 28, 2013

Google provides some background on the User-Agent in mobile Chrome versions here:
https://developers.google.com/chrome/mobile/docs/user-agent

CrMo is changed to Chrome/<Chrome Rev> Mobile in recent versions of the mobile browsers, but the existing CrMo check in browser.php should be kept to catch older versions.

Regarding CriOS, we see that the User-Agent string in Chrome for iOS is the same as the Mobile Safari User-Agent, with CriOS/<ChromeRevision> instead of Version/<VersionNum>.

I haven't tested, but it looks like browser.php today finds Safari but are unable to get the version numbers (in identifyBrowserVersion()).

The question is whether Chrome on iOS should be reported as Chrome (as in the pull req) or as Safari. The first is more correct from a "user" perspective, as we report the browser in use with the correct matched version number. The latter is more correct from a "technical" perspective, as Chrome on iOS use the UIWebView rendering engine provided in iOS (but I have a hard time seeing how we can pick a proper version number).

dongilbert added a commit that referenced this pull request Mar 16, 2013

Merge pull request #1841 from axelsjo/patch-1
Joomla CMS [#29922] Detect Chrome for iOS in browser.php

@dongilbert dongilbert merged commit 0ba693c into joomla:staging Mar 16, 2013

Contributor

dongilbert commented Mar 16, 2013

As it is very similar to an already fixed tracker item, and it's adding no BC problems, I'll merge this.

@axelsjo axelsjo deleted the axelsjo:patch-1 branch Mar 16, 2013

@brianteeman brianteeman referenced this pull request in joomla/joomla-cms Apr 5, 2013

Closed

Detect Chrome for iOS in browser.php #956

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.