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-28 15:26:32 +00:00
|
|
|
userLanguage: window.navigator.userLanguage,
|
|
|
|
language: window.navigator.language,
|
2022-03-28 17:54:45 +00:00
|
|
|
cookieEnabled: true,
|
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
|
|
|
});
|