Skip to content
This repository has been archived by the owner on Apr 11, 2024. It is now read-only.

Commit

Permalink
Add KaiOS support and Alcatel as a manufacturer.
Browse files Browse the repository at this point in the history
Closes #160.
  • Loading branch information
bnjmnt4n committed Jun 23, 2020
1 parent 385e3fc commit 97d2621
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
4 changes: 3 additions & 1 deletion platform.js
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,7 @@
/* Detectable manufacturers. */
var manufacturer = getManufacturer({
'Apple': { 'iPad': 1, 'iPhone': 1, 'iPod': 1 },
'Alcatel': {},
'Archos': {},
'Amazon': { 'Kindle': 1, 'Kindle Fire': 1 },
'Asus': { 'Transformer': 1 },
Expand All @@ -457,6 +458,7 @@
/* Detectable operating systems (order is important). */
var os = getOS([
'Windows Phone',
'KaiOS',
'Android',
'CentOS',
{ 'label': 'Chrome OS', 'pattern': 'CrOS' },
Expand Down Expand Up @@ -823,7 +825,7 @@
(prerelease == 'beta' ? beta : alpha) + (/\d+\+?/.exec(data) || '');
}
// Detect Firefox Mobile.
if (name == 'Fennec' || name == 'Firefox' && /\b(?:Android|Firefox OS)\b/.test(os)) {
if (name == 'Fennec' || name == 'Firefox' && /\b(?:Android|Firefox OS|KaiOS)\b/.test(os)) {
name = 'Firefox Mobile';
}
// Obscure Maxthon's unreliable version.
Expand Down
19 changes: 19 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -913,6 +913,16 @@
'version': '26.0'
},

'Firefox Mobile 37.0 on Alcatel 4044T (KaiOS 1.0)': {
'ua': 'Mozilla/5.0 (Mobile; ALCATEL4044T; rv:37.0) Gecko/37.0 Firefox/37.0 KaiOS/1.0',
'layout': 'Gecko',
'manufacturer': 'Alcatel',
'name': 'Firefox Mobile',
'os': 'KaiOS 1.0',
'product': 'Alcatel 4044T',
'version': '37.0'
},

'Firefox Mobile 43.0 on Mobile (Android 4.3)': {
'ua': 'Mozilla/5.0 (Android 4.3; Mobile; rv:43.0) Gecko/43.0 Firefox/43.0',
'layout': 'Gecko',
Expand All @@ -931,6 +941,15 @@
'version': '44.0'
},

'Firefox Mobile 48.0 on Mobile (KaiOS 2.0)': {
'ua': 'Mozilla/5.0 (Mobile; LYF/F30C/LYF_F30C-000-09-21-021018; Android; rv:48.0) Gecko/48.0 Firefox/48.0 KAIOS/2.0',
'layout': 'Gecko',
'name': 'Firefox Mobile',
'os': 'KaiOS 2.0',
'product': 'Mobile',
'version': '48.0'
},

'Firefox Mobile 49.0 on Mobile (Android 4.4.2)': {
'ua': 'Mozilla/5.0 (Android 4.4.2; Mobile; rv:49.0) Gecko/49.0 Firefox/49.0',
'layout': 'Gecko',
Expand Down

0 comments on commit 97d2621

Please sign in to comment.