improve: website compatibility

This commit is contained in:
Andrei O 2022-04-05 12:43:03 +03:00
parent ba9ff1d202
commit 9524d11fe8
No known key found for this signature in database
GPG Key ID: B961E5B68389457E

View File

@ -10,6 +10,7 @@ const navClones = {
platform: window.navigator.platform,
vendor: window.navigator.vendor,
language: window.navigator.language,
oscpu: window.navigator.oscpu,
cookieEnabled: true,
appCodeName: window.navigator.appCodeName,
appName: window.navigator.appName,
@ -24,10 +25,12 @@ const navClones = {
registerProtocolHandler: window.navigator.registerProtocolHandler.bind(window.navigator),
requestMediaKeySystemAccess: window.navigator.requestMediaKeySystemAccess.bind(window.navigator),
requestMIDIAccess: window.navigator.requestMIDIAccess.bind(window.navigator),
bluetooth: window.navigator.bluetooth.bind(window.navigator),
onLine: window.navigator.onLine,
};
const skipPropList = [...Object.keys(navClones), 'brave'];
for (let prop in window.navigator) {
if (prop === 'brave') {
if (skipPropList.includes(prop)) {
continue;
}
newNav[prop] = copyNavRef[prop];
@ -44,4 +47,4 @@ Object.defineProperty(window, 'navigator', {
writable: true,
enumerable: true,
configurable: true,
});
});