refactor: imp performance added a problematic website

This commit is contained in:
Andrei O 2022-04-06 21:48:14 +03:00
parent fffba0ae00
commit d0252dc0db
No known key found for this signature in database
GPG Key ID: B961E5B68389457E

View File

@ -18,9 +18,22 @@ Navigator = Navigator.bind(window.navigator);
newNav = new Navigator(window.navigator); newNav = new Navigator(window.navigator);
delete window.navigator.__proto__.brave; delete window.navigator.__proto__.brave;
newNav.__proto__.__proto__ = window.navigator.__proto__; newNav.__proto__.__proto__ = window.navigator.__proto__;
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', { Object.defineProperty(window, 'navigator', {
value: newNav, value: newNav,
writable: false, writable: false,
enumerable: false, enumerable: false,
configurable: false, configurable: false,
}); });
}