Skip to content

Commit e665bd5

Browse files
committed
Backport - Add new OS: Ubuntu Touch
(cherry picked from commit 594b6b1)
1 parent 20c3040 commit e665bd5

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/ua-parser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -843,7 +843,7 @@
843843
/(ubuntu) ([\w\.]+) like android/i // Ubuntu Touch
844844
], [[NAME, /(.+)/, '$1 Touch'], VERSION], [
845845
// Android/Blackberry/WebOS/QNX/Bada/RIM/KaiOS/Maemo/MeeGo/S40/Sailfish OS/OpenHarmony/Tizen
846-
/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen|webos)\w*[-\/; ]?([\d\.]*)/i
846+
/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen|webos)\w*[-\/\.; ]?([\d\.]*)/i
847847
], [NAME, VERSION], [
848848
/\(bb(10);/i // BlackBerry 10
849849
], [VERSION, [NAME, BLACKBERRY]], [

test/os-test.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,15 @@
539539
"version" : "undefined"
540540
}
541541
},
542+
{
543+
"desc" : "Ubuntu Touch",
544+
"ua" : "Mozilla/5.0 (Linux; Ubuntu 16.04 like Android 4.4) AppleWebKit/537.36 Chromium/65.0.3325.151 Mobile Safari/537.36",
545+
"expect" :
546+
{
547+
"name" : "Ubuntu Touch",
548+
"version" : "16.04"
549+
}
550+
},
542551
{
543552
"desc" : "Kubuntu",
544553
"ua" : "Mozilla/5.0 (compatible; Konqueror/4.4; Linux 2.6.32-22-generic; X11; en_US) KHTML/4.4.3 (like Gecko) Kubuntu",

0 commit comments

Comments
 (0)