Skip to content

Commit bcf642a

Browse files
committed
Fix macOS Big Sur detection for 11.1, 11.2, 11.3 and later
1 parent 9babf9d commit bcf642a

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

src/Analyser/Derive.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ private function deriveBasedOnOperatingSystem()
485485
$this->data->os->version->nickname = 'Catalina';
486486
}
487487

488-
if ($this->data->os->version->is('11.0')) {
488+
if ($this->data->os->version->is('11')) {
489489
$this->data->os->version->nickname = 'Big Sur';
490490
}
491491
}

tests/data/desktop/platform-electron.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,27 @@
1414
headers: 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) AtomShellDefaultApp/0.1.0 Chrome/37.0.2062.102 AtomShell/0.17.2 Safari/537.36'
1515
result: { browser: { using: { name: Electron, version: 0.17.2 }, family: { name: Chrome, version: 37 }, type: browser }, engine: { name: Blink }, os: { name: Linux }, device: { type: desktop } }
1616
readable: 'Electron 0.17.2 on Linux'
17+
-
18+
headers: 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 11_0_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.40 Electron/11.0.0-beta.20 Safari/537.36'
19+
readable: 'Electron 11.0.0 on macOS Big Sur 11.0'
20+
result: { browser: { using: { name: Electron, version: 11.0.0 }, family: { name: Chrome, version: 87 }, type: browser }, engine: { name: Blink }, os: { name: 'OS X', alias: macOS, version: { value: '11.0', nickname: 'Big Sur' } }, device: { type: desktop, manufacturer: Apple, model: Macintosh } }
21+
-
22+
headers: 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.67 Electron/11.0.3 Safari/537.36'
23+
readable: 'Electron 11.0.3 on macOS Big Sur 11.1'
24+
result: { browser: { using: { name: Electron, version: 11.0.3 }, family: { name: Chrome, version: 87 }, type: browser }, engine: { name: Blink }, os: { name: 'OS X', alias: macOS, version: { value: '11.1', nickname: 'Big Sur' } }, device: { type: desktop, manufacturer: Apple, model: Macintosh } }
25+
-
26+
headers: 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.67 Electron/11.0.3 Safari/537.36'
27+
readable: 'Electron 11.0.3 on macOS Big Sur 11.2'
28+
result: { browser: { using: { name: Electron, version: 11.0.3 }, family: { name: Chrome, version: 87 }, type: browser }, engine: { name: Blink }, os: { name: 'OS X', alias: macOS, version: { value: '11.2', nickname: 'Big Sur' } }, device: { type: desktop, manufacturer: Apple, model: Macintosh } }
29+
-
30+
headers: 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Electron/11.3.0 Safari/537.36'
31+
readable: 'Electron 11.3.0 on macOS Big Sur 11.2'
32+
result: { browser: { using: { name: Electron, version: 11.3.0 }, family: { name: Chrome, version: 87 }, type: browser }, engine: { name: Blink }, os: { name: 'OS X', alias: macOS, version: { value: '11.2', nickname: 'Big Sur' } }, device: { type: desktop, manufacturer: Apple, model: Macintosh } }
33+
-
34+
headers: 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.128 Electron/12.0.5 Safari/537.36'
35+
readable: 'Electron 12.0.5 on macOS Big Sur 11.2'
36+
result: { browser: { using: { name: Electron, version: 12.0.5 }, family: { name: Chrome, version: 89 }, type: browser }, engine: { name: Blink }, os: { name: 'OS X', alias: macOS, version: { value: '11.2', nickname: 'Big Sur' } }, device: { type: desktop, manufacturer: Apple, model: Macintosh } }
37+
-
38+
headers: 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 11_3_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.128 Electron/12.0.6 Safari/537.36'
39+
readable: 'Electron 12.0.6 on macOS Big Sur 11.3'
40+
result: { browser: { using: { name: Electron, version: 12.0.6 }, family: { name: Chrome, version: 89 }, type: browser }, engine: { name: Blink }, os: { name: 'OS X', alias: macOS, version: { value: '11.3', nickname: 'Big Sur' } }, device: { type: desktop, manufacturer: Apple, model: Macintosh } }

0 commit comments

Comments
 (0)