Feat: Web loader
This commit is contained in:
19
Loader/scripts/hints.js
Normal file
19
Loader/scripts/hints.js
Normal file
@@ -0,0 +1,19 @@
|
||||
// Path: Loader/scripts/hints.js
|
||||
|
||||
export const collectClientHints = () => {
|
||||
const navigatorConnection = navigator.connection || navigator.mozConnection || navigator.webkitConnection;
|
||||
|
||||
return {
|
||||
capturedAt: new Date().toISOString(),
|
||||
language: navigator.language,
|
||||
languages: Array.isArray(navigator.languages) ? navigator.languages : [],
|
||||
hardwareConcurrency: navigator.hardwareConcurrency ?? null,
|
||||
deviceMemory: navigator.deviceMemory ?? null,
|
||||
networkType: navigatorConnection?.effectiveType ?? null,
|
||||
saveData: navigatorConnection?.saveData ?? null,
|
||||
viewport: {
|
||||
width: window.innerWidth,
|
||||
height: window.innerHeight,
|
||||
},
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user