Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new browser: Cobalt #604

Merged
merged 7 commits into from Oct 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion bower.json
@@ -1,6 +1,6 @@
{
"name": "ua-parser-js",
"version": "0.7.31",
"version": "0.7.32",
"authors": [
"Faisal Salman <f@faisalman.com>"
],
Expand Down
2 changes: 1 addition & 1 deletion dist/ua-parser.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/ua-parser.pack.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.js
@@ -1,6 +1,6 @@
Package.describe({
name: 'faisalman:ua-parser-js',
version: '0.7.31',
version: '0.7.32',
summary: 'Lightweight JavaScript-based user-agent string parser',
git: 'https://github.com/faisalman/ua-parser-js.git',
documentation: 'readme.md'
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,7 +1,7 @@
{
"title": "UAParser.js",
"name": "ua-parser-js",
"version": "0.7.31",
"version": "0.7.32",
"author": "Faisal Salman <f@faisalman.com> (http://faisalman.com)",
"description": "Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent data. Supports browser & node.js environment",
"keywords": [
Expand Down
9 changes: 6 additions & 3 deletions src/ua-parser.js
@@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////////////
/* UAParser.js v0.7.31
/* UAParser.js v0.7.32
Copyright © 2012-2021 Faisal Salman <f@faisalman.com>
MIT License *//*
Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent data.
Expand All @@ -17,7 +17,7 @@
/////////////


var LIBVERSION = '0.7.31',
var LIBVERSION = '0.7.32',
EMPTY = '',
UNKNOWN = '?',
FUNC_TYPE = 'function',
Expand Down Expand Up @@ -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 : [[
Expand Down
36 changes: 36 additions & 0 deletions test/browser-test.json
Expand Up @@ -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"
}
}
]