From d0252dc0db9050a52bc5b4853a3f76ee97034569 Mon Sep 17 00:00:00 2001 From: Andrei O Date: Wed, 6 Apr 2022 21:48:14 +0300 Subject: [PATCH] refactor: imp performance added a problematic website --- block-script.js | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/block-script.js b/block-script.js index 5f3194c..a975b23 100644 --- a/block-script.js +++ b/block-script.js @@ -18,9 +18,22 @@ Navigator = Navigator.bind(window.navigator); newNav = new Navigator(window.navigator); delete window.navigator.__proto__.brave; newNav.__proto__.__proto__ = window.navigator.__proto__; -Object.defineProperty(window, 'navigator', { - value: newNav, - writable: false, - enumerable: false, - configurable: false, + +const websiteExceptions = ['accounts.google']; + +const check = websiteExceptions.find((website) => { + if (window.location.hostname.includes(website)) { + return true; + } }); + +if (check) { + window.navigator.brave = undefined; +} else { + Object.defineProperty(window, 'navigator', { + value: newNav, + writable: false, + enumerable: false, + configurable: false, + }); +} \ No newline at end of file