62 lines
1.7 KiB
JavaScript
62 lines
1.7 KiB
JavaScript
(() => {
|
|
const windowsUA = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.7444.163 Safari/537.36';
|
|
const appVersion = '5.0 (Windows)';
|
|
|
|
const override = (obj, key, value) => {
|
|
try {
|
|
Object.defineProperty(obj, key, {
|
|
get: () => value,
|
|
configurable: true
|
|
});
|
|
} catch (error) {
|
|
// no-op
|
|
}
|
|
};
|
|
|
|
override(Navigator.prototype, 'userAgent', windowsUA);
|
|
override(Navigator.prototype, 'appVersion', appVersion);
|
|
override(Navigator.prototype, 'platform', 'Win32');
|
|
override(Navigator.prototype, 'oscpu', 'Windows NT 10.0; Win64; x64');
|
|
|
|
if (navigator.userAgentData) {
|
|
const uaData = {
|
|
brands: [
|
|
{ brand: 'Chromium', version: '142' },
|
|
{ brand: 'Google Chrome', version: '142' }
|
|
],
|
|
mobile: false,
|
|
platform: 'Windows',
|
|
getHighEntropyValues: async (hints) => {
|
|
const result = {
|
|
architecture: 'x86',
|
|
bitness: '64',
|
|
mobile: false,
|
|
model: '',
|
|
platform: 'Windows',
|
|
platformVersion: '10.0.0',
|
|
uaFullVersion: '142.0.7444.163',
|
|
wow64: false
|
|
};
|
|
|
|
if (Array.isArray(hints)) {
|
|
return hints.reduce((acc, hint) => {
|
|
if (hint in result) acc[hint] = result[hint];
|
|
return acc;
|
|
}, {});
|
|
}
|
|
|
|
return result;
|
|
},
|
|
toJSON: () => ({
|
|
brands: [
|
|
{ brand: 'Chromium', version: '142' },
|
|
{ brand: 'Google Chrome', version: '142' }
|
|
],
|
|
mobile: false,
|
|
platform: 'Windows'
|
|
})
|
|
};
|
|
|
|
override(Navigator.prototype, 'userAgentData', uaData);
|
|
}
|
|
})();
|