From 83197a0dad0f611d2dbbd96ddb95e8fc95045e8f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 7 Feb 2026 16:13:39 +0000 Subject: [PATCH] Revert navigator.brave.isBrave() support Co-authored-by: naorpeled <6171622+naorpeled@users.noreply.github.com> --- src/parser-browsers.js | 4 ---- src/parser.js | 11 ----------- test/unit/parser.js | 22 ---------------------- 3 files changed, 37 deletions(-) diff --git a/src/parser-browsers.js b/src/parser-browsers.js index 9cd18f7..4d91891 100644 --- a/src/parser-browsers.js +++ b/src/parser-browsers.js @@ -1023,10 +1023,6 @@ const browsersList = [ /* Brave Browser */ { test(parser) { - // Check navigator.brave.isBrave() result from hints - if (parser.isBrave()) { - return true; - } // Check Client Hints brands for Brave return parser.hasBrand('Brave'); }, diff --git a/src/parser.js b/src/parser.js index 92ed027..0f51189 100644 --- a/src/parser.js +++ b/src/parser.js @@ -13,7 +13,6 @@ import Utils from './utils.js'; * @property {string} [architecture] CPU architecture * @property {string} [model] Device model * @property {boolean} [wow64] Whether running under WoW64 - * @property {boolean} [isBrave] Result of navigator.brave.isBrave() for Brave browser detection */ /** @@ -124,16 +123,6 @@ class Parser { return brand ? brand.version : undefined; } - /** - * Check if the browser is Brave using navigator.brave.isBrave() result - * @return {boolean} - * - * @public - */ - isBrave() { - return !!(this._hints && this._hints.isBrave === true); - } - /** * Get UserAgent string of current Parser instance * @return {String} User-Agent String of the current object diff --git a/test/unit/parser.js b/test/unit/parser.js index 17b8c78..bb3f22e 100644 --- a/test/unit/parser.js +++ b/test/unit/parser.js @@ -413,25 +413,3 @@ 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'); -});