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

Add support for navigator.brave.isBrave() detection

Co-authored-by: naorpeled <6171622+naorpeled@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-02-01 22:26:29 +00:00
parent f5d89c124d
commit dfdb36ce96
3 changed files with 37 additions and 0 deletions

View File

@@ -413,3 +413,25 @@ test('Parser.getBrandVersion returns version for Brave', (t) => {
const p = new Parser(BRAVE_UA, false, BRAVE_HINTS);
t.is(p.getBrandVersion('Brave'), '1.73.97');
});
test('Parser.isBrave returns true when isBrave hint is set', (t) => {
const hints = { isBrave: true };
const p = new Parser(BRAVE_UA, false, hints);
t.true(p.isBrave());
});
test('Parser.isBrave returns false when isBrave hint is not set', (t) => {
const p = new Parser(BRAVE_UA, false, BRAVE_HINTS);
t.false(p.isBrave());
});
test('Parser.isBrave returns false when no hints provided', (t) => {
const p = new Parser(BRAVE_UA);
t.false(p.isBrave());
});
test('Parser detects Brave from isBrave hint', (t) => {
const hints = { isBrave: true };
const p = new Parser(BRAVE_UA, false, hints);
t.is(p.getBrowserName(), 'Brave');
});