@@ -248,7 +248,6 @@ export const collectWebglFingerprintInfo = () => {
248248 const version = gl . getParameter ( gl . VERSION ) || "N/A" ;
249249 const shadingLanguageVersion = gl . getParameter ( gl . SHADING_LANGUAGE_VERSION ) || "N/A" ;
250250
251- const extensions = gl . getSupportedExtensions ( ) || [ ] ;
252251 const fingerprintData = `${ vendor } | ${ renderer } | ${ version } | ${ shadingLanguageVersion } ` ;
253252 return {
254253 status : "ok" ,
@@ -257,7 +256,6 @@ export const collectWebglFingerprintInfo = () => {
257256 renderer,
258257 version,
259258 shadingLanguageVersion,
260- extensionsCount : extensions . length ,
261259 error : "" ,
262260 } ;
263261 } catch ( error ) {
@@ -430,72 +428,18 @@ export const collectWebRtcInfo = async () => {
430428 }
431429} ;
432430
433- export const collectFingerprintInfo = async ( ) => {
431+ export const collectFingerprintInfo = ( ) => {
434432 try {
435433 const screenInfo = {
436434 width : screen . width || 0 ,
437435 height : screen . height || 0 ,
438436 colorDepth : screen . colorDepth || 0 ,
439- availWidth : screen . availWidth || 0 ,
440- availHeight : screen . availHeight || 0 ,
441- pixelRatio : window . devicePixelRatio || 1 ,
442- orientation : screen . orientation ?. type || "N/A" ,
443437 } ;
444438
445- const hardware = {
446- cores : navigator . hardwareConcurrency || 0 ,
447- // @ts -expect-error deviceMemory 为非标准但 Chromium 支持的指纹面
448- memory : navigator . deviceMemory || 0 ,
449- maxTouchPoints : navigator . maxTouchPoints || 0 ,
450- } ;
451-
452- const media = ( query ) => ( typeof matchMedia === "function" && matchMedia ( query ) . matches ) || false ;
453- const display = {
454- colorGamut : media ( "(color-gamut: rec2020)" ) ? "rec2020" : media ( "(color-gamut: p3)" ) ? "p3" : "srgb" ,
455- dynamicRange : media ( "(dynamic-range: high)" ) ? "high" : "standard" ,
456- prefersColorScheme : media ( "(prefers-color-scheme: dark)" ) ? "dark" : "light" ,
457- prefersReducedMotion : media ( "(prefers-reduced-motion: reduce)" ) ,
458- prefersContrast : media ( "(prefers-contrast: more)" ) ? "more" : "no-preference" ,
459- } ;
460-
461- // @ts -expect-error NetworkInformation 为非标准但 Chromium 支持
462- const connection = navigator . connection
463- ? {
464- // @ts -expect-error 同上
465- effectiveType : navigator . connection . effectiveType || "N/A" ,
466- // @ts -expect-error 同上
467- downlink : navigator . connection . downlink ?? null ,
468- // @ts -expect-error 同上
469- rtt : navigator . connection . rtt ?? null ,
470- // @ts -expect-error 同上
471- saveData : ! ! navigator . connection . saveData ,
472- }
473- : null ;
474-
475- let storage = null ;
476- if ( navigator . storage ?. estimate ) {
477- try {
478- const estimate = await navigator . storage . estimate ( ) ;
479- storage = { quota : estimate . quota ?? 0 , usage : estimate . usage ?? 0 } ;
480- } catch ( _error ) { }
481- }
482-
483- let voices = null ;
484- if ( typeof speechSynthesis !== "undefined" ) {
485- try {
486- voices = speechSynthesis . getVoices ( ) . length ;
487- } catch ( _error ) { }
488- }
489-
490439 return {
491440 status : "ok" ,
492441 userAgent : navigator . userAgent || "N/A" ,
493442 screen : screenInfo ,
494- hardware,
495- display,
496- connection,
497- storage,
498- voices,
499443 timezone : Intl . DateTimeFormat ( ) . resolvedOptions ( ) . timeZone || "N/A" ,
500444 timezoneOffset : new Date ( ) . getTimezoneOffset ( ) ,
501445 error : "" ,
@@ -506,11 +450,6 @@ export const collectFingerprintInfo = async () => {
506450 status : "error" ,
507451 userAgent : "N/A" ,
508452 screen : { width : 0 , height : 0 , colorDepth : 0 } ,
509- hardware : null ,
510- display : null ,
511- connection : null ,
512- storage : null ,
513- voices : null ,
514453 timezone : "N/A" ,
515454 timezoneOffset : 0 ,
516455 error : error ?. message || String ( error ) ,
0 commit comments