Skip to content

Commit

Permalink
Split Firefox into Firefox and Firefox Mobile (#5625)
Browse files Browse the repository at this point in the history
* split Firefox in Firefox and Firefox Mobile

* Firefox on iOS is also Firefox Mobile

* add Firefox Mobile to mobileOnlyBrowsers
  • Loading branch information
Findus23 authored and sgiehl committed Jun 5, 2017
1 parent 2e3082f commit 0d158ac
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 17 deletions.
5 changes: 3 additions & 2 deletions Parser/Client/Browser.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ class Browser extends ClientParserAbstract
'FE' => 'Fennec',
'FF' => 'Firefox',
'FL' => 'Flock',
'FM' => 'Firefox Mobile',
'FW' => 'Fireweb',
'FN' => 'Fireweb Navigator',
'GA' => 'Galeon',
Expand Down Expand Up @@ -182,7 +183,7 @@ class Browser extends ClientParserAbstract
'Baidu' => array('BD', 'BS'),
'Amiga' => array('AV', 'AW'),
'Chrome' => array('CH', 'BR', 'CC', 'CD', 'CM', 'CI', 'CF', 'CN', 'CR', 'CP', 'IR', 'RM', 'AO', 'TS', 'VI'),
'Firefox' => array('FF', 'FE', 'SX', 'FB', 'PX', 'MB'),
'Firefox' => array('FF', 'FE', 'FM', 'SX', 'FB', 'PX', 'MB'),
'Internet Explorer' => array('IE', 'IM', 'PS'),
'Konqueror' => array('KO'),
'NetFront' => array('NF'),
Expand All @@ -198,7 +199,7 @@ class Browser extends ClientParserAbstract
* @var array
*/
protected static $mobileOnlyBrowsers = array(
'36', 'PU', 'SK', 'OI', 'DB', 'ST', 'BL', 'IV'
'36', 'PU', 'SK', 'OI', 'DB', 'ST', 'BL', 'IV', 'FM'
);

/**
Expand Down
4 changes: 2 additions & 2 deletions Tests/Parser/Client/fixtures/browser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -552,8 +552,8 @@
user_agent: Mozilla/5.0 (iPhone; CPU iPhone OS 8_3 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) FxiOS/1.0 Mobile/12F69 Safari/600.1.4
client:
type: browser
name: Firefox
short_name: FF
name: Firefox Mobile
short_name: FM
version: "iOS 1.0"
engine: WebKit
engine_version: "600.1.4"
Expand Down
16 changes: 8 additions & 8 deletions Tests/fixtures/smartphone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
platform:
client:
type: browser
name: Firefox
short_name: FF
name: Firefox Mobile
short_name: FM
version: "22.0"
engine: Gecko
engine_version: "22.0"
Expand All @@ -28,8 +28,8 @@
platform:
client:
type: browser
name: Firefox
short_name: FF
name: Firefox Mobile
short_name: FM
version: "26.0"
engine: Gecko
engine_version: "26.0"
Expand Down Expand Up @@ -585,8 +585,8 @@
platform:
client:
type: browser
name: Firefox
short_name: FF
name: Firefox Mobile
short_name: FM
version: "18.1"
engine: Gecko
engine_version: "18.1"
Expand Down Expand Up @@ -1181,8 +1181,8 @@
platform:
client:
type: browser
name: Firefox
short_name: FF
name: Firefox Mobile
short_name: FM
version: "18.1"
engine: Gecko
engine_version: "18.1"
Expand Down
8 changes: 4 additions & 4 deletions Tests/fixtures/tablet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
platform:
client:
type: browser
name: Firefox
short_name: FF
name: Firefox Mobile
short_name: FM
version: "20.0"
engine: Gecko
engine_version: "20.0"
Expand All @@ -28,8 +28,8 @@
platform:
client:
type: browser
name: Firefox
short_name: FF
name: Firefox Mobile
short_name: FM
version: "26.0"
engine: Gecko
engine_version: "26.0"
Expand Down
9 changes: 8 additions & 1 deletion regexes/client/browsers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,13 @@
engine:
default: 'Gecko'

#Firefox Mobile
- regex: '(Mobile|Tablet).*Firefox(?:/(\d+[\.\d]+))?'
name: 'Firefox Mobile'
version: '$2'
engine:
default: 'Gecko'

#Firefox
- regex: 'Firefox(?:/(\d+[\.\d]+))?'
name: 'Firefox'
Expand All @@ -186,7 +193,7 @@
engine:
default: 'Gecko'
- regex: 'FxiOS/(\d+[\.\d]+)'
name: 'Firefox'
name: 'Firefox Mobile'
version: 'iOS $1'
engine:
default: 'WebKit'
Expand Down

0 comments on commit 0d158ac

Please sign in to comment.