1
0
mirror of https://github.com/lancedikson/bowser synced 2026-03-02 03:40:27 +00:00

feat: add Vivaldi client hints support

This commit is contained in:
naorpeled
2026-02-13 23:09:48 +02:00
parent 587196f211
commit cf397a4b50
3 changed files with 65 additions and 2 deletions

View File

@@ -761,11 +761,29 @@ const browsersList = [
},
},
{
test: [/vivaldi/i],
describe(ua) {
test(parser) {
// Check Client Hints brands for Vivaldi
if (parser.hasBrand('Vivaldi')) {
return true;
}
// Fall back to UA string detection
return parser.test(/vivaldi/i);
},
describe(ua, parser) {
const browser = {
name: 'Vivaldi',
};
// Try Client Hints brand version first
if (parser) {
const hintsVersion = parser.getBrandVersion('Vivaldi');
if (hintsVersion) {
browser.version = hintsVersion;
return browser;
}
}
// Fall back to UA string version
const version = Utils.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i, ua);
if (version) {