diff --git a/src/main/ua-parser.js b/src/main/ua-parser.js index 8becf71..1d13db5 100755 --- a/src/main/ua-parser.js +++ b/src/main/ua-parser.js @@ -1001,7 +1001,7 @@ ], [VERSION, [NAME, BLACKBERRY]], [ /(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i // Symbian ], [VERSION, [NAME, 'Symbian']], [ - /mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i // Firefox OS + /mozilla\/[\d\.]+ \((?:mobile[;\w ]*|tablet|tv|[^\)]*(?:viera|lg(?:l25|-d300)|alcatel ?o.+|y300-f1)); rv:([\w\.]+)\).+gecko\//i // Firefox OS ], [VERSION, [NAME, FIREFOX+' OS']], [ /\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i, // WebOS /webos(?:[ \/]?|\.tv-20(?=2[2-9]))(\d[\d\.]*)/i @@ -1017,7 +1017,6 @@ ], [[NAME, "Chrome OS"], VERSION],[ // Smart TVs - /panasonic;(viera)/i, // Panasonic Viera /(netrange)mmh/i, // Netrange /(nettv)\/(\d+\.[\w\.]+)/i, // NetTV diff --git a/test/data/ua/os/firefox-os.json b/test/data/ua/os/firefox-os.json index faf081a..58acfe7 100644 --- a/test/data/ua/os/firefox-os.json +++ b/test/data/ua/os/firefox-os.json @@ -25,5 +25,59 @@ "name" : "Firefox OS", "version" : "44.0" } + }, + { + "desc" : "Firefox OS on Alcatel One Touch Fire", + "ua" : "Mozilla/5.0 (Mobile; ALCATELOneTouch4012X; rv:18.1) Gecko/18.1 Firefox/18.1", + "expect" : + { + "name" : "Firefox OS", + "version" : "18.1" + } + }, + { + "desc" : "Firefox OS on Huawei Y300II", + "ua" : "Mozilla/5.0 (Mobile; HUAWEIY300-F1; rv:18.1) Gecko/18.1 Firefox/18.1", + "expect" : + { + "name" : "Firefox OS", + "version" : "18.1" + } + }, + { + "desc" : "Firefox OS on LG Fireweb", + "ua" : "Mozilla/5.0 (Mobile; LG-D300; rv:18.1) Gecko/18.1 Firefox/18.1", + "expect" : + { + "name" : "Firefox OS", + "version" : "18.1" + } + }, + { + "desc" : "Firefox OS on LG FX0", + "ua" : "Mozilla/5.0 (Mobile; LGL25; rv:32.0) Gecko/32.0 Firefox/32.0", + "expect" : + { + "name" : "Firefox OS", + "version" : "32.0" + } + }, + { + "desc" : "Firefox OS on Panasonic Viera TV", + "ua" : "Mozilla/5.0 (Linux; Viera; rv:34.0) Gecko/20100101 Firefox/34.0", + "expect" : + { + "name" : "Firefox OS", + "version" : "34.0" + } + }, + { + "desc" : "Firefox OS on ZTE Open", + "ua" : "Mozilla/5.0 (Mobile; ZTEOPEN; rv:18.1) Gecko/18.1 Firefox/18.1", + "expect" : + { + "name" : "Firefox OS", + "version" : "18.1" + } } ] \ No newline at end of file diff --git a/test/data/ua/os/freebsd.json b/test/data/ua/os/freebsd.json index 74544a0..db4f3ff 100644 --- a/test/data/ua/os/freebsd.json +++ b/test/data/ua/os/freebsd.json @@ -7,5 +7,14 @@ "name" : "FreeBSD", "version" : "undefined" } + }, + { + "desc" : "FreeBSD", + "ua" : "Mozilla/5.0 (X11; FreeBSD; U; Viera; pl-PL) AppleWebKit/537.11 (KHTML, like Gecko) Viera/3.3.3 Chrome/23.0.1271.97 Safari/537.11", + "expect" : + { + "name" : "FreeBSD", + "version" : "undefined" + } } ] \ No newline at end of file