Brave-Detection-Blocker-Chr.../block-script.js

32 lines
783 B
JavaScript
Raw Normal View History

2022-03-27 11:43:26 +00:00
let nav = function Navigator() {};
let copyNavRef = window.navigator;
nav = nav.bind(function () {
return window.navigator;
});
newNav = new nav();
2022-03-25 18:10:48 +00:00
const alreadyProxifiedNav = {
2022-03-27 11:43:26 +00:00
userAgent: window.navigator.userAgent,
appVersion: window.navigator.appVersion,
platform: window.navigator.platform,
vendor: window.navigator.vendor,
2022-03-25 18:10:48 +00:00
};
for (let prop in window.navigator) {
if (prop === 'brave') {
continue;
}
2022-03-27 11:43:26 +00:00
newNav.prop = copyNavRef.prop;
2022-03-25 18:10:48 +00:00
}
for (let prop in alreadyProxifiedNav) {
alreadyProxifiedNav.hasOwnProperty(prop) &&
Object.defineProperty(newNav, prop, {
value: alreadyProxifiedNav[prop],
writable: true,
});
}
Object.defineProperty(window, 'navigator', {
value: newNav,
writable: true,
2022-03-27 11:43:26 +00:00
enumerable: true,
configurable: true,
2022-03-25 18:10:48 +00:00
});