8000 Adds detection for Puffin OS, Puffin Cloud Browser, Puffin Incognito Browser and renames Puffin to Puffin Secure Browser by liviuconcioiu · Pull Request #7819 · matomo-org/device-detector · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Adds detection for Puffin OS, Puffin Cloud Browser, Puffin Incognito Browser and renames Puffin to Puffin Secure Browser #7819

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions DeviceDetector.php
Original file line number Diff line number Diff line change
Expand Up @@ -1039,6 +1039,27 @@ protected function parseDevice(): void
$this->device = AbstractDeviceParser::DEVICE_TYPE_TABLET;
}

/**
* All devices running Puffin Secure Browser that contain letter 'D' are assumed to be desktops
*/
if (null === $this->device && $this->matchUserAgent('Puffin/(?:\d+[.\d]+)[LMW]D')) {
$this->device = AbstractDeviceParser::DEVICE_TYPE_DESKTOP;
}

/**
* All devices running Puffin Web Browser that contain letter 'P' are assumed to be smartphones
*/
if (null === $this->device && $this->matchUserAgent('Puffin/(?:\d+[.\d]+)[AIFLW]P')) {
$this->device = AbstractDeviceParser::DEVICE_TYPE_SMARTPHONE;
}

/**
* All devices running Puffin Web Browser that contain letter 'T' are assumed to be tablets
*/
if (null === $this->device && $this->matchUserAgent('Puffin/(?:\d+[.\d]+)[AILW]T')) {
$this->device = AbstractDeviceParser::DEVICE_TYPE_TABLET;
}

/**
* All devices running Opera TV Store are assumed to be a tv
*/
Expand Down
11 changes: 7 additions & 4 deletions Parser/Client/Browser.php
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,9 @@ class Browser extends AbstractClientParser
'PP' => 'Oppo Browser',
'P6' => 'Opus Browser',
'PR' => 'Palm Pre',
'PU' => 'Puffin',
'7I' => 'Puffin Cloud Browser',
'6I' => 'Puffin Incognito Browser',
'PU' => 'Puffin Secure Browser',
'2P' => 'Puffin Web Browser',
'PW' => 'Palm WebPro',
'PA' => 'Palmscape',
Expand Down Expand Up @@ -764,7 +766,7 @@ class Browser extends AbstractClientParser
'K4', 'WK', 'T3', 'K5', 'MU', '9P', 'K6', 'VR', 'N9',
'M9', 'F9', '0P', '0A', 'JR', 'D3', 'TK', 'BP', '2F',
'2M', 'K7', '1N', '8A', 'H7', 'X3', 'T4', 'X4', '5O',
'8C', '3M',
'8C', '3M', '6I', '2P', 'PU', '7I',
],
'Firefox' => [
'FF', 'BI', 'BF', 'BH', 'BN', 'C0', 'CU', 'EI', 'F1',
Expand Down Expand Up @@ -793,7 +795,7 @@ class Browser extends AbstractClientParser
'36', 'AH', 'AI', 'BL', 'C1', 'C4', 'CB', 'CW', 'DB',
'3M', 'DT', 'EU', 'EZ', 'FK', 'FM', 'FR', 'FX', 'GH',
'GI', 'GR', 'HA', 'HU', 'IV', 'JB', 'KD', 'M1', 'MF',
'MN', 'MZ', 'NX', 'OC', 'OI', 'OM', 'OZ', 'PU', 'PI',
'MN', 'MZ', 'NX', 'OC', 'OI', 'OM', 'OZ', '2P', 'PI',
'PE', 'QU', 'RE', 'S0', 'S7', 'SA', 'SB', 'SG', 'SK',
'ST', 'SU', 'T1', 'UH', 'UM', 'UT', 'VE', 'VV', 'WI',
'WP', 'YN', 'IO', 'IS', 'HQ', 'RW', 'HI', 'PN', 'BW',
Expand All @@ -812,7 +814,8 @@ class Browser extends AbstractClientParser
'5A', 'TT', '6P', 'G3', '7P', 'VU', 'F8', 'L4', 'DK',
'DP', 'KL', 'K4', 'N6', 'KU', 'WK', 'M8', 'UP', 'ZT',
'9P', 'N8', 'VR', 'N9', 'M9', 'F9', '0P', '0A', '2F',
'2M', 'K7', '1N', '8A', 'H7', 'X3', 'X4', '5O',
'2M', 'K7', '1N', '8A', 'H7', 'X3', 'X4', '5O', '6I',
'7I',
];

/**
Expand Down
3 changes: 2 additions & 1 deletion Parser/OperatingSystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ class OperatingSystem extends AbstractParser
'PSP' => 'PlayStation Portable',
'PS3' => 'PlayStation',
'PVE' => 'Proxmox VE',
'PUF' => 'Puffin OS',
'PUR' => 'PureOS',
'QTP' => 'Qtopia',
'PIO' => 'Raspberry Pi OS',
Expand Down Expand Up @@ -232,7 +233,7 @@ class OperatingSystem extends AbstractParser
'Android' => [
'AND', 'CYN', 'FIR', 'REM', 'RZD', 'MLD', 'MCD', 'YNS', 'GRI', 'HAR',
'ADR', 'CLR', 'BOS', 'REV', 'LEN', 'SIR', 'RRS', 'WER', 'PIC', 'ARM',
'HEL', 'BYI', 'RIS',
'HEL', 'BYI', 'RIS', 'PUF',
],
'AmigaOS' => ['AMG', 'MOR', 'ARO'],
'BlackBerry' => ['BLB', 'QNX'],
Expand Down
109 changes: 106 additions & 3 deletions Tests/Parser/Client/fixtures/browser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1395,14 +1395,14 @@
engine_version: 525.27.1
family: ""
-
user_agent: 'Mozilla/5.0 (X11; U; Linux x86_64; fa-ir) AppleWebKit/534.35 (KHTML, like Gecko) Chrome/11.0.696.65 Safari/534.35 Puffin/2.10977AP'
user_agent: Mozilla/5.0 (X11; U; Linux x86_64; fa-ir) AppleWebKit/534.35 (KHTML, like Gecko) Chrome/11.0.696.65 Safari/534.35 Puffin/2.10977AP
client:
type: browser
name: Puffin
name: Puffin Web Browser
version: "2.10977"
engine: WebKit
engine_version: "534.35"
family: ""
family: Chrome
-
< 9E7A /td> user_agent: Mozilla/4.76 (compatible; MSIE 6.0; U; Windows 95; PalmSource; PalmOS; WebPro; Tungsten Proxyless 1.1 320x320x16)
client:
Expand Down Expand Up @@ -10165,3 +10165,106 @@
family: Chrome
headers:
Sec-CH-UA: '"Not_A Brand";v="8", "Chromium";v="120", "Mises";v="120"'
-
user_agent: Mozilla/5.0 (Linux; Android 13; SM-A137F Build/TP1A.220624.014; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/112.0.5615.136 Mobile Safari/537.36
client:
type: browser
name: Puffin Incognito Browser
version: ""
engine: Blink
engine_version: 112.0.5615.136
family: Chrome
headers:
http-x-requested-with: com.cloudmosa.puffinIncognito
-
user_agent: Mozilla/5.0 (Cloud Phone; Generic) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.6367.243 Mobile Safari/537.36 Puffin/12.1.1.51391FP
client:
type: browser
name: Puffin Cloud Browser
version: 12.1.1.51391
engine: Blink
engine_version: 124.0.6367.243
family: Chrome
-
user_agent: Mozilla/5.0 (iPhone; CPU iPhone OS 17_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/21G93 Safari/604.1 Puffin/8.0.2LP
client:
type: browser
name: Puffin Web Browser
version: 8.0.2
engine: WebKit
engine_version: 605.1.15
family: Chrome
-
user_agent: Mozilla/5.0 (Linux; Android 14; V2315 Build/UP1A.231005.007; en-us) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.66 Mobile Safari/537.36 Puffin/10.2.1.51662AP
client:
type: browser
name: Puffin Web Browser
version: 10.2.1.51662
engine: Blink
engine_version: 87.0.4280.66
family: Chrome
-
user_agent: Mozilla/5.0 (iPod; U; CPU iPhone OS 6_1 like Mac OS X; en-HK) AppleWebKit/534.35 (KHTML, like Gecko) Chrome/11.0.696.65 Safari/534.35 Puffin/3.9174IP Mobile
client:
type: browser
name: Puffin Web Browser
version: "3.9174"
engine: WebKit
engine_version: "534.35"
family: Chrome
-
user_agent: Mozilla/5.0 (X11; U; Linux i686; en-gb) AppleWebKit/534.35 (KHTML, like Gecko) Chrome/11.0.696.65 Safari/534.35 Puffin/2.0.5603M
client:
type: browser
name: Puffin Web Browser
version: 2.0.5603
engine: WebKit
engine_version: "534.35"
family: Chrome
-
user_agent: Mozilla/5.0 (X11; U; Linux aarch64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36 Puffin/8.2.4.705LD
client:
type: browser
name: Puffin Secure Browser
version: 8.2.4.705
engine: Blink
engine_version: 69.0.3497.100
family: Chrome
-
user_agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_16_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36 Puffin/7.9.0.102MD
client:
type: browser
name: Puffin Secure Browser
version: 7.9.0.102
engine: Blink
engine_version: 69.0.3497.100
family: Chrome
-
user_agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.136 Safari/537.36 Puffin/9.0.1.982WD
client:
type: browser
name: Puffin Secure Browser
version: 9.0.1.982
engine: Blink
engine_version: 79.0.3945.136
family: Chrome
-
user_agent: Mozilla/5.0 (X11; U; Linux i686; en-CA) AppleWebKit/534.35 (KHTML, like Gecko) Chrome/11.0.696.65 Safari/534.35 Puffin/2.0.5603
client:
type: browser
name: Puffin Web Browser
version: 2.0.5603
engine: WebKit
engine_version: "534.35"
family: Chrome
-
user_agent: Mozilla/5.0 (Linux; Android 13; SM-A137F Build/TP1A.220624.014; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/112.0.5615.136 Mobile Safari/537.36
client:
type: browser
name: Puffin Cloud Browser
version: ""
engine: Blink
engine_version: 112.0.5615.136
family: Chrome
headers:
http-x-requested-with: com.cloudmosa.puffinCloudBrowser
10 changes: 9 additions & 1 deletion Tests/Parser/fixtures/oss.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5207,7 +5207,15 @@
platform: ""
family: iOS
-
user_agent: AlMosafer/iPhone/17.0.3/8.10.0/1094/BDD0D3CE-EA37-4825-9E01-D26E91F38570/iPhone
user_agent: Mozilla/5.0 (Cloud Phone; Generic) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.6367.243 Mobile Safari/537.36 Puffin/12.1.1.51391FP
os:
name: Puffin OS
short_name: PUF
version: ""
platform: ""
family: Android
-
ser_agent: AlMosafer/iPhone/17.0.3/8.10.0/1094/BDD0D3CE-EA37-4825-9E01-D26E91F38570/iPhone
os:
name: iOS
short_name: IOS
Expand Down
2 changes: 1 addition & 1 deletion Tests/Parser/fixtures/type-methods.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
user_agent: Opera/9.80 (J2ME/MIDP; Opera Mini/9.5/37.8069; U; en) Presto/2.12.423 Version/12.16
check: [false, true, false, false, false, false]
-
user_agent: 'Mozilla/5.0 (X11; U; Linux i686; th-TH@calendar=gregorian) AppleWebKit/534.12 (KHTML, like Gecko) Puffin/1.3.2665MS Safari/534.12'
user_agent: 'Mozilla/5.0 (Linux; Android 14; V2315 Build/UP1A.231005.007; en-us) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.66 Mobile Safari/537.36 Puffin/10.2.1.51662AP'
check: [false, true, false, false, false, false]
-
user_agent: Mozilla/5.0 (Linux; Android 4.4.4; MX4 Pro Build/KTU84P) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/33.0.0.0 Mobile Safari/537.36; 360 Aphone Browser (6.9.7)
Expand Down
18 changes: 18 additions & 0 deletions Tests/fixtures/desktop-1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,21 @@
model: ""
os_family: Mac
browser_family: Chrome
-
user_agent: Mozilla/5.0 (X11; U; Linux aarch64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36 Puffin/8.2.4.705LD
os:
name: GNU/Linux
version: ""
platform: ARM
client:
type: browser
name: Puffin Secure Browser
version: 8.2.4.705
engine: Blink
engine_version: 69.0.3497.100
device:
type: desktop
brand: ""
model: ""
os_family: GNU/Linux
browser_family: Chrome
4 changes: 2 additions & 2 deletions Tests/fixtures/smartphone-15.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3604,7 +3604,7 @@
platform: ""
client:
type: browser
name: Puffin
name: Puffin Web Browser
version: 7.5.3.20547
engine: Blink
engine_version: 63.0.3239.111
Expand All @@ -3613,7 +3613,7 @@
A377 brand: teXet
model: X-Driver Quad
os_family: Android
browser_family: Unknown
browser_family: Chrome
-
user_agent: Mozilla/5.0 (Linux; Android 6.0; X-Force(TM-5009) Build/MRA58K; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/69.0.3497.91 Mobile Safari/537.36
os:
Expand Down
4 changes: 2 additions & 2 deletions Tests/fixtures/smartphone-19.yml
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@
platform: ""
client:
type: browser
name: Puffin
name: Puffin Web Browser
version: 8.4.0.42081
engine: Blink
engine_version: 69.0.3497.100
Expand All @@ -412,7 +412,7 @@
brand: Oukitel
model: U16 Max
os_family: Android
browser_family: Unknown
browser_family: Chrome
-
user_agent: Mozilla/5.0 (Linux; Android 7.0; U7 Max) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.87 Mobile Safari/537.36
os:
Expand Down
4 changes: 2 additions & 2 deletions Tests/fixtures/smartphone-2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2050,7 +2050,7 @@
platform: ""
client:
type: browser
name: Puffin
name: Puffin Web Browser
version: 7.8.3.40913
engine: Blink
engine_version: 69.0.3497.100
Expand All @@ -2059,7 +2059,7 @@
brand: Asus
model: ZenFone 3 Max
os_family: Android
browser_family: Unknown
browser_family: Chrome
-
user_agent: Mozilla/5.0 (Linux; Android 7.0; ASUS_A001) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.76 Mobile Safari/537.36
os:
Expand Down
4 changes: 2 additions & 2 deletions Tests/fixtures/smartphone-24.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2889,7 +2889,7 @@
platform: ""
client:
type: browser
name: Puffin
name: Puffin Web Browser
version: 7.5.0.20369
engine: Blink
engine_version: 63.0.3239.111
Expand All @@ -2898,7 +2898,7 @@
brand: LG
model: L Bello
os_family: Android
browser_family: Unknown
browser_family: Chrome
-
user_agent: Mozilla/5.0 (Linux; Android 9; LGL322DL) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.92 Mobile Safari/537.36
os:
Expand Down
4 changes: 2 additions & 2 deletions Tests/fixtures/smartphone-28.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9501,7 +9501,7 @@
platform: ""
client:
type: browser
name: Puffin
name: Puffin Web Browser
version: 9.6.0.51126
engine: Blink
engine_version: 79.0.3945.136
Expand All @@ -9510,7 +9510,7 @@
brand: Reeder
model: P13 Blue Max
os_family: Android
browser_family: Unknown
browser_family: Chrome
-
user_agent: Mozilla/5.0 (Linux; Android 11; Redmi K30 Pro Zoom Edition) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.87 Mobile Safari/537.36
os:
Expand Down
4 changes: 2 additions & 2 deletions Tests/fixtures/smartphone-29.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8913,7 +8913,7 @@
platform: ""
client:
type: browser
name: Puffin
name: Puffin Web Browser
version: 7.8.2.40664
engine: Blink
engine_version: 69.0.3497.100
Expand All @@ -8922,7 +8922,7 @@
brand: Fly
model: Cirrus 2
os_family: Android
browser_family: Unknown
browser_family: Chrome
-
user_agent: Mozilla/5.0 (Linux; Android 9; lineage_serranoltexx) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Mobile Safari/537.36
os:
Expand Down
4 changes: 2 additions & 2 deletions Tests/fixtures/smartphone-3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1605,7 +1605,7 @@
platform: ""
client:
type: browser
name: Puffin
name: Puffin Web Browser
version: 7.8.1.40497
engine: Blink
engine_version: 69.0.3497.81
Expand All @@ -1614,7 +1614,7 @@
brand: bq
model: Fresh
os_family: Android
browser_family: Unknown
browser_family: Chrome
-
user_agent: Mozilla/5.0 Linux; Android 8.1.0; BQ-5002G Build/OPM2.171019.012 AppleWebKit/537.36 KHTML, like Gecko Chrome/72.0.3626.121 Mobile Safari/537.36
os:
Expand Down
Loading
Loading
0