@@ -108,14 +108,7 @@ const FINGERPRINT_PAYLOAD = {
108108 doNotTrack : null ,
109109 plugins : [ 'PDF Viewer' , 'Chrome PDF Viewer' , 'Chromium PDF Viewer' ] ,
110110
111- // Canvas hardware
112- canvas : 'a1b2c3d4e5f6g7h8i9j0' ,
113- webgl : {
114- vendor : 'Google Inc. (Apple)' ,
115- renderer : 'ANGLE (Apple, Apple M1 Pro, OpenGL 4.1)' ,
116- } ,
117-
118- // Audio hardware
111+ // Audio hardware (canvas/webgl fingerprints are neutralized at build time via AST rewriting)
119112 audioFingerprint : 124.04347527516074 ,
120113
121114 // Font detection
@@ -248,10 +241,6 @@ describe('proxy privacy - payload analysis', () => {
248241 vectors . push ( 'timezone' )
249242 if ( fp . plugins )
250243 vectors . push ( 'plugins' )
251- if ( fp . canvas )
252- vectors . push ( 'canvas' )
253- if ( fp . webgl )
254- vectors . push ( 'webgl' )
255244 if ( fp . audioFingerprint )
256245 vectors . push ( 'audioFingerprint' )
257246 if ( fp . fonts )
@@ -345,9 +334,7 @@ describe('stripFingerprintingFromPayload', () => {
345334 expect ( result . plugins ) . toEqual ( [ ] )
346335 expect ( result . fonts ) . toEqual ( [ ] )
347336
348- // Canvas/WebGL/Audio replaced with empty (pure fingerprints)
349- expect ( result . canvas ) . toBe ( '' )
350- expect ( result . webgl ) . toEqual ( { } )
337+ // Audio fingerprint replaced with empty (canvas/webgl neutralized at build time)
351338 expect ( result . audioFingerprint ) . toBe ( 0 )
352339
353340 // Timezone generalized
@@ -470,7 +457,7 @@ describe('selective privacy in stripPayloadFingerprinting', () => {
470457 ul : 'en-US,en;q=0.9,fr;q=0.8' ,
471458 sr : '2560x1440' ,
472459 hardwareConcurrency : 8 ,
473- canvas : 'abc123' ,
460+ audiofingerprint : 124.5 ,
474461 timezone : 'America/New_York' ,
475462 dt : 'Page Title' ,
476463 }
@@ -483,13 +470,13 @@ describe('selective privacy in stripPayloadFingerprinting', () => {
483470 expect ( result . sr ) . toBe ( '1920x1080' ) // generalized
484471 } )
485472
486- it ( 'screen:false → screen/hardware pass through, canvas/ timezone still anonymized' , ( ) => {
473+ it ( 'screen:false → screen/hardware pass through, timezone still anonymized' , ( ) => {
487474 const privacy : ResolvedProxyPrivacy = { ip : true , userAgent : true , language : true , screen : false , timezone : true , hardware : true }
488475 const result = stripPayloadFingerprinting ( testPayload , privacy )
489476 expect ( result . uip ) . toBe ( '192.168.1.0' ) // anonymized
490477 expect ( result . sr ) . toBe ( '2560x1440' ) // not generalized (screen flag off)
491478 expect ( result . hardwareConcurrency ) . toBe ( 8 ) // not bucketed (screen flag off)
492- expect ( result . canvas ) . toBe ( '' ) // stripped (hardware flag on)
479+ expect ( result . audiofingerprint ) . toBe ( 0 ) // stripped (hardware flag on)
493480 expect ( result . timezone ) . toBe ( 'UTC' ) // generalized (timezone flag on)
494481 } )
495482
@@ -498,15 +485,15 @@ describe('selective privacy in stripPayloadFingerprinting', () => {
498485 const result = stripPayloadFingerprinting ( testPayload , privacy )
499486 expect ( result . timezone ) . toBe ( 'America/New_York' ) // not generalized (timezone flag off)
500487 expect ( result . sr ) . toBe ( '1920x1080' ) // generalized (screen flag on)
501- expect ( result . canvas ) . toBe ( '' ) // stripped (hardware flag on)
488+ expect ( result . audiofingerprint ) . toBe ( 0 ) // stripped (hardware flag on)
502489 } )
503490
504- it ( 'hardware:false → canvas /versions pass through' , ( ) => {
491+ it ( 'hardware:false → audio /versions pass through' , ( ) => {
505492 const privacy : ResolvedProxyPrivacy = { ip : true , userAgent : true , language : true , screen : true , timezone : true , hardware : false }
506493 const result = stripPayloadFingerprinting ( testPayload , privacy )
507494 expect ( result . uip ) . toBe ( '192.168.1.0' ) // anonymized (ip flag on)
508495 expect ( result . sr ) . toBe ( '1920x1080' ) // generalized (screen flag on)
509- expect ( result . canvas ) . toBe ( 'abc123' ) // not stripped (hardware flag off)
496+ expect ( result . audiofingerprint ) . toBe ( 124.5 ) // not stripped (hardware flag off)
510497 expect ( result . timezone ) . toBe ( 'UTC' ) // generalized (timezone flag on)
511498 } )
512499
@@ -517,7 +504,7 @@ describe('selective privacy in stripPayloadFingerprinting', () => {
517504 expect ( result . ua ) . toBe ( testPayload . ua )
518505 expect ( result . ul ) . toBe ( 'en-US,en;q=0.9,fr;q=0.8' )
519506 expect ( result . sr ) . toBe ( '2560x1440' )
520- expect ( result . canvas ) . toBe ( 'abc123' )
507+ expect ( result . audiofingerprint ) . toBe ( 124.5 )
521508 expect ( result . timezone ) . toBe ( 'America/New_York' )
522509 } )
523510
0 commit comments