From 8d3c2d327cf540ff2c050f1cc67bca8c6f8e4458 Mon Sep 17 00:00:00 2001 From: Oscar Becerra Date: Mon, 17 Oct 2022 14:03:53 -0700 Subject: [PATCH] Add new browser: Cobalt --- src/ua-parser.js | 5 ++++- test/browser-test.json | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/src/ua-parser.js b/src/ua-parser.js index b47ad2364..e2c326364 100755 --- a/src/ua-parser.js +++ b/src/ua-parser.js @@ -330,7 +330,10 @@ /(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i, // Polaris/Lynx/Dillo/iCab/Doris/Amaya/w3m/NetSurf/Sleipnir/Obigo/Mosaic/Go/ICE/UP.Browser /(links) \(([\w\.]+)/i // Links - ], [NAME, VERSION] + ], [NAME, VERSION], [ + + /(cobalt)\/([\w\.]+)/i // Cobalt + ], [NAME, [VERSION, /master.|lts./, ""]] ], cpu : [[ diff --git a/test/browser-test.json b/test/browser-test.json index bf8163a1f..2be58c21b 100644 --- a/test/browser-test.json +++ b/test/browser-test.json @@ -1591,5 +1591,41 @@ "version" : "15.6,2", "major" : "15" } + }, + { + "desc" : "Cobalt 23 Master", + "ua" : "Mozilla/5.0 (X11; Linux x86_64) Cobalt/23.master.0.0-devel (unlike Gecko) v8/8.8.278.8-jit gles Starboard/15", + "expect" : { + "name" : "Cobalt", + "version": "23.0.0", + "major" : "23" + } + }, + { + "desc" : "Cobalt 23 LTS", + "ua" : "Mozilla/5.0 (X11; Linux x86_64) Cobalt/23.lts.1.0-qa (unlike Gecko) v8/8.8.278.8-jit gles Starboard/15", + "expect" : { + "name" : "Cobalt", + "version": "23.1.0", + "major" : "23" + } + }, + { + "desc" : "Cobalt 11", + "ua" : "Mozilla/5.0 (X11; Linux x86_64) Cobalt/11.0-qa (unlike Gecko) Starboard/6", + "expect" : { + "name" : "Cobalt", + "version": "11.0", + "major" : "11" + } + }, + { + "desc" : "Cobalt 9", + "ua" : "Mozilla/5.0 (X11; Linux x86_64) Cobalt/9.0-qa (unlike Gecko) Starboard/4", + "expect" : { + "name" : "Cobalt", + "version": "9.0", + "major" : "9" + } } ]