From 732cf5834e6a8605c75f48db492a14426345d475 Mon Sep 17 00:00:00 2001 From: Faisal Salman Date: Fri, 23 Nov 2018 10:26:00 +0700 Subject: [PATCH] Fix #337 - Samsung Smart-TV --- src/ua-parser.js | 3 +++ test/device-test.json | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/src/ua-parser.js b/src/ua-parser.js index 114eaad..d982c4e 100755 --- a/src/ua-parser.js +++ b/src/ua-parser.js @@ -769,6 +769,9 @@ /\s(mobile)(?:[;\/]|\ssafari)/i // Unidentifiable Mobile ], [[TYPE, util.lowerize], VENDOR, MODEL], [ + /[\s\/\(](smart-?tv)[;\)]/i // SmartTV + ], [[TYPE, SMARTTV]], [ + /(android[\w\.\s\-]{0,9});.+build/i // Generic Android Device ], [MODEL, [VENDOR, 'Generic']] diff --git a/test/device-test.json b/test/device-test.json index e5f8c6c..a283f76 100644 --- a/test/device-test.json +++ b/test/device-test.json @@ -369,6 +369,15 @@ "type": "smarttv" } }, + { + "desc": "Samsung SmartTV", + "ua": "Mozilla/5.0 (SMART-TV; X11; Linux armv7l) AppleWebkit/537.42 (KHTML, like Gecko) Safari/537.42", + "expect": { + "vendor": "undefined", + "model": "undefined", + "type": "smarttv" + } + }, { "desc": "Samsung SmartTV", "ua": "Mozilla/5.0 (SMART-TV; Linux; Tizen 2.3) AppleWebkit/538.1 (KHTML, like Gecko) SamsungBrowser/1.0 TV Safari/538.1",