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