Skip to content

Commit

Permalink
Merge pull request #604 from obecerra3/master
Browse files Browse the repository at this point in the history
Add new browser: Cobalt
  • Loading branch information
faisalman authored Oct 23, 2022
2 parents cb5da5e + 8d3c2d3 commit c239ac5
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 8 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ua-parser-js",
"version": "0.7.31",
"version": "0.7.32",
"authors": [
"Faisal Salman <[email protected]>"
],
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"title": "UAParser.js",
"name": "ua-parser-js",
"version": "0.7.31",
"version": "0.7.32",
"author": "Faisal Salman <[email protected]> (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
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////////////
/* UAParser.js v0.7.31
/* UAParser.js v0.7.32
Copyright © 2012-2021 Faisal Salman <[email protected]>
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
Original file line number Diff line number Diff line change
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"
}
}
]

1 comment on commit c239ac5

@obecerra3
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks faisalman !

Please sign in to comment.