fix: sendBeacon

This commit is contained in:
Andrei O 2022-03-28 22:47:37 +03:00
parent 10f762bb1f
commit 34bfafd046
No known key found for this signature in database
GPG Key ID: B961E5B68389457E

View File

@ -9,7 +9,6 @@ const primitivesNav = {
appVersion: window.navigator.appVersion,
platform: window.navigator.platform,
vendor: window.navigator.vendor,
userLanguage: window.navigator.userLanguage,
language: window.navigator.language,
cookieEnabled: true,
appCodeName: window.navigator.appCodeName,
@ -17,13 +16,14 @@ const primitivesNav = {
product: window.navigator.product,
geolocation: window.navigator.geolocation,
onLine: window.navigator.onLine,
sendBeacon: window.navigator.sendBeacon.bind(window.navigator),
};
for (let prop in window.navigator) {
if (prop === 'brave') {
continue;
}
newNav.prop = copyNavRef.prop;
newNav[prop] = copyNavRef[prop];
}
for (let prop in primitivesNav) {
primitivesNav.hasOwnProperty(prop) &&
@ -37,4 +37,4 @@ Object.defineProperty(window, 'navigator', {
writable: true,
enumerable: true,
configurable: true,
});
});