From c7a0f778ff9c49e26c4b14239a2a390a8de2613c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 22 Nov 2025 22:09:26 +0000 Subject: [PATCH] Add Smart TV platform detection Co-authored-by: naorpeled <6171622+naorpeled@users.noreply.github.com> --- src/parser-platforms.js | 44 ++++++++++++++++++ test/acceptance/useragentstrings.yml | 67 ++++++++++++++++++++++++++++ 2 files changed, 111 insertions(+) diff --git a/src/parser-platforms.js b/src/parser-platforms.js index 74889a5..83d7d6e 100644 --- a/src/parser-platforms.js +++ b/src/parser-platforms.js @@ -461,6 +461,50 @@ export default [ }, }, + /* Smart TV */ + { + test: [/smart-?tv|smarttv/i], + describe() { + return { + type: PLATFORMS_MAP.tv, + }; + }, + }, + + /* Tizen (Samsung Smart TV OS) */ + { + test(parser) { + return parser.getOSName(true) === 'tizen'; + }, + describe() { + return { + type: PLATFORMS_MAP.tv, + }; + }, + }, + + /* WebOS (LG Smart TV OS) */ + { + test(parser) { + return parser.getOSName(true) === 'webos'; + }, + describe() { + return { + type: PLATFORMS_MAP.tv, + }; + }, + }, + + /* NetCast (LG Smart TV) */ + { + test: [/netcast/i], + describe() { + return { + type: PLATFORMS_MAP.tv, + }; + }, + }, + /* desktop */ { test(parser) { diff --git a/test/acceptance/useragentstrings.yml b/test/acceptance/useragentstrings.yml index 8f99243..5754708 100644 --- a/test/acceptance/useragentstrings.yml +++ b/test/acceptance/useragentstrings.yml @@ -3641,3 +3641,70 @@ engine: name: "Gecko" version: "20100101" + Samsung Smart TV: + - + ua: "Mozilla/5.0 (SMART-TV; Linux; Tizen 2.4.0) AppleWebkit/538.1 (KHTML, like Gecko) SamsungBrowser/1.1 TV Safari/538.1" + spec: + browser: + name: "Samsung Internet for Android" + version: "1.1" + os: + name: "Tizen" + version: "2.4.0" + platform: + type: "tv" + engine: + name: "WebKit" + version: "538.1" + - + ua: "Mozilla/5.0 (SMART-TV; X11; Linux armv7l) AppleWebKit/537.42 (KHTML, like Gecko) Chromium/25.0.1349.2 Chrome/25.0.1349.2 Safari/537.42" + spec: + browser: + name: "Chrome" + version: "25.0.1349.2" + os: + name: "Linux" + platform: + type: "tv" + engine: + name: "WebKit" + version: "537.42" + - + ua: "Mozilla/5.0 (SmartHub; SMART-TV; U; Linux/SmartTV) AppleWebKit/531.2+ (KHTML, like Gecko) WebBrowser/1.0 SmartTV Safari/531.2+" + spec: + browser: + name: "Generic" + version: "1.0" + os: + name: "Linux" + platform: + type: "tv" + engine: + name: "WebKit" + version: "531.2" + LG Smart TV: + - + ua: "Mozilla/5.0 (Web0S; Linux/SmartTV) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.122 Safari/537.36 WebAppManager" + spec: + browser: + name: "Chrome" + version: "38.0.2125.122" + os: + name: "WebOS" + platform: + type: "tv" + engine: + name: "Blink" + - + ua: "Mozilla/5.0 (Linux; NetCast; U) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.33 Safari/537.31" + spec: + browser: + name: "Chrome" + version: "26.0.1410.33" + os: + name: "Linux" + platform: + type: "tv" + engine: + name: "WebKit" + version: "537.31"