jumpy-lion 0.1.6-beta.0 → 0.1.6-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/README.md +13 -0
  2. package/dist/browser-controller.d.ts.map +1 -1
  3. package/dist/browser-controller.js +57 -2
  4. package/dist/browser-controller.js.map +1 -1
  5. package/dist/browser-plugin.d.ts +49 -0
  6. package/dist/browser-plugin.d.ts.map +1 -1
  7. package/dist/browser-plugin.js +103 -1
  8. package/dist/browser-plugin.js.map +1 -1
  9. package/dist/browser-process/anti-detect-browser.d.ts +56 -0
  10. package/dist/browser-process/anti-detect-browser.d.ts.map +1 -0
  11. package/dist/browser-process/anti-detect-browser.js +142 -0
  12. package/dist/browser-process/anti-detect-browser.js.map +1 -0
  13. package/dist/browser-process/anti-detect-config.d.ts +102 -0
  14. package/dist/browser-process/anti-detect-config.d.ts.map +1 -0
  15. package/dist/browser-process/anti-detect-config.js +328 -0
  16. package/dist/browser-process/anti-detect-config.js.map +1 -0
  17. package/dist/browser-process/browser.d.ts +26 -0
  18. package/dist/browser-process/browser.d.ts.map +1 -1
  19. package/dist/browser-process/browser.js +115 -6
  20. package/dist/browser-process/browser.js.map +1 -1
  21. package/dist/browser-process/get-chrome-executable.d.ts +7 -0
  22. package/dist/browser-process/get-chrome-executable.d.ts.map +1 -1
  23. package/dist/browser-process/get-chrome-executable.js +42 -0
  24. package/dist/browser-process/get-chrome-executable.js.map +1 -1
  25. package/dist/browser-process/index.d.ts +4 -1
  26. package/dist/browser-process/index.d.ts.map +1 -1
  27. package/dist/browser-process/index.js +3 -1
  28. package/dist/browser-process/index.js.map +1 -1
  29. package/dist/crawler.d.ts +17 -0
  30. package/dist/crawler.d.ts.map +1 -1
  31. package/dist/crawler.js +5 -2
  32. package/dist/crawler.js.map +1 -1
  33. package/dist/fingerprinting/fingerprint-injector.d.ts +54 -0
  34. package/dist/fingerprinting/fingerprint-injector.d.ts.map +1 -1
  35. package/dist/fingerprinting/fingerprint-injector.js +207 -58
  36. package/dist/fingerprinting/fingerprint-injector.js.map +1 -1
  37. package/dist/fingerprinting/fingerprint-overrides/audio-spoofing.d.ts.map +1 -1
  38. package/dist/fingerprinting/fingerprint-overrides/audio-spoofing.js +16 -0
  39. package/dist/fingerprinting/fingerprint-overrides/audio-spoofing.js.map +1 -1
  40. package/dist/fingerprinting/fingerprint-overrides/cdp-detection-bypass.d.ts.map +1 -1
  41. package/dist/fingerprinting/fingerprint-overrides/cdp-detection-bypass.js +3 -2
  42. package/dist/fingerprinting/fingerprint-overrides/cdp-detection-bypass.js.map +1 -1
  43. package/dist/fingerprinting/fingerprint-overrides/datadome-bypass.d.ts.map +1 -1
  44. package/dist/fingerprinting/fingerprint-overrides/datadome-bypass.js +18 -10
  45. package/dist/fingerprinting/fingerprint-overrides/datadome-bypass.js.map +1 -1
  46. package/dist/fingerprinting/fingerprint-overrides/index.d.ts +1 -2
  47. package/dist/fingerprinting/fingerprint-overrides/index.d.ts.map +1 -1
  48. package/dist/fingerprinting/fingerprint-overrides/index.js +1 -2
  49. package/dist/fingerprinting/fingerprint-overrides/index.js.map +1 -1
  50. package/dist/fingerprinting/fingerprint-overrides/keyboard-humanization.d.ts +10 -2
  51. package/dist/fingerprinting/fingerprint-overrides/keyboard-humanization.d.ts.map +1 -1
  52. package/dist/fingerprinting/fingerprint-overrides/keyboard-humanization.js +11 -2
  53. package/dist/fingerprinting/fingerprint-overrides/keyboard-humanization.js.map +1 -1
  54. package/dist/fingerprinting/fingerprint-overrides/locale-spoofing.d.ts +20 -2
  55. package/dist/fingerprinting/fingerprint-overrides/locale-spoofing.d.ts.map +1 -1
  56. package/dist/fingerprinting/fingerprint-overrides/locale-spoofing.js +47 -250
  57. package/dist/fingerprinting/fingerprint-overrides/locale-spoofing.js.map +1 -1
  58. package/dist/fingerprinting/fingerprint-overrides/mouse-humanization.d.ts +12 -1
  59. package/dist/fingerprinting/fingerprint-overrides/mouse-humanization.d.ts.map +1 -1
  60. package/dist/fingerprinting/fingerprint-overrides/mouse-humanization.js +27 -22
  61. package/dist/fingerprinting/fingerprint-overrides/mouse-humanization.js.map +1 -1
  62. package/dist/fingerprinting/fingerprint-overrides/platform-consistency.d.ts.map +1 -1
  63. package/dist/fingerprinting/fingerprint-overrides/platform-consistency.js +86 -28
  64. package/dist/fingerprinting/fingerprint-overrides/platform-consistency.js.map +1 -1
  65. package/dist/fingerprinting/fingerprint-overrides/scroll-humanization.d.ts +9 -2
  66. package/dist/fingerprinting/fingerprint-overrides/scroll-humanization.d.ts.map +1 -1
  67. package/dist/fingerprinting/fingerprint-overrides/scroll-humanization.js +10 -2
  68. package/dist/fingerprinting/fingerprint-overrides/scroll-humanization.js.map +1 -1
  69. package/dist/fingerprinting/fingerprint-overrides/stealth-script.d.ts.map +1 -1
  70. package/dist/fingerprinting/fingerprint-overrides/stealth-script.js +165 -33
  71. package/dist/fingerprinting/fingerprint-overrides/stealth-script.js.map +1 -1
  72. package/dist/fingerprinting/fingerprint-overrides/storage-consistency.d.ts.map +1 -1
  73. package/dist/fingerprinting/fingerprint-overrides/storage-consistency.js +10 -8
  74. package/dist/fingerprinting/fingerprint-overrides/storage-consistency.js.map +1 -1
  75. package/dist/fingerprinting/fingerprint-overrides/timing-consistency.d.ts.map +1 -1
  76. package/dist/fingerprinting/fingerprint-overrides/timing-consistency.js +9 -7
  77. package/dist/fingerprinting/fingerprint-overrides/timing-consistency.js.map +1 -1
  78. package/dist/fingerprinting/fingerprint-overrides/ua-ch.js +6 -6
  79. package/dist/fingerprinting/fingerprint-overrides/utils.d.ts.map +1 -1
  80. package/dist/fingerprinting/fingerprint-overrides/utils.js +44 -1
  81. package/dist/fingerprinting/fingerprint-overrides/utils.js.map +1 -1
  82. package/dist/fingerprinting/fingerprint-overrides/webgl-spoofing.d.ts.map +1 -1
  83. package/dist/fingerprinting/fingerprint-overrides/webgl-spoofing.js +43 -1
  84. package/dist/fingerprinting/fingerprint-overrides/webgl-spoofing.js.map +1 -1
  85. package/dist/fingerprinting/fingerprint-overrides/webgpu-spoofing.d.ts.map +1 -1
  86. package/dist/fingerprinting/fingerprint-overrides/webgpu-spoofing.js +9 -1
  87. package/dist/fingerprinting/fingerprint-overrides/webgpu-spoofing.js.map +1 -1
  88. package/dist/fingerprinting/fingerprint-overrides/webrtc-spoofing.d.ts.map +1 -1
  89. package/dist/fingerprinting/fingerprint-overrides/webrtc-spoofing.js +14 -3
  90. package/dist/fingerprinting/fingerprint-overrides/webrtc-spoofing.js.map +1 -1
  91. package/dist/fingerprinting/locale-resolver.d.ts +41 -0
  92. package/dist/fingerprinting/locale-resolver.d.ts.map +1 -0
  93. package/dist/fingerprinting/locale-resolver.js +155 -0
  94. package/dist/fingerprinting/locale-resolver.js.map +1 -0
  95. package/dist/fingerprinting/non-apify-fingerprint-generator.d.ts +32 -0
  96. package/dist/fingerprinting/non-apify-fingerprint-generator.d.ts.map +1 -0
  97. package/dist/fingerprinting/non-apify-fingerprint-generator.js +480 -0
  98. package/dist/fingerprinting/non-apify-fingerprint-generator.js.map +1 -0
  99. package/dist/keyboard-layout.d.ts +45 -0
  100. package/dist/keyboard-layout.d.ts.map +1 -0
  101. package/dist/keyboard-layout.js +162 -0
  102. package/dist/keyboard-layout.js.map +1 -0
  103. package/dist/page.d.ts +18 -0
  104. package/dist/page.d.ts.map +1 -1
  105. package/dist/page.js +96 -6
  106. package/dist/page.js.map +1 -1
  107. package/dist/tsconfig.build.tsbuildinfo +1 -1
  108. package/package.json +6 -1
  109. package/dist/fingerprinting/fingerprint-overrides/coalesced-events-spoofing.d.ts +0 -10
  110. package/dist/fingerprinting/fingerprint-overrides/coalesced-events-spoofing.d.ts.map +0 -1
  111. package/dist/fingerprinting/fingerprint-overrides/coalesced-events-spoofing.js +0 -210
  112. package/dist/fingerprinting/fingerprint-overrides/coalesced-events-spoofing.js.map +0 -1
@@ -66,6 +66,13 @@ export const createDataDomeBypassScript = () => {
66
66
  return min + r * (max - min);
67
67
  };
68
68
 
69
+ // Compute Chrome version from navigator.userAgent (set by CDP before page load).
70
+ // This ensures UA-CH brands/versions always match the actual Chrome UA regardless of
71
+ // which Chrome version the fingerprint uses, preventing version-mismatch detection.
72
+ const _chrM = navigator.userAgent.match(/Chrome\\/(\d+)\.(\d+\.\d+\.\d+)/);
73
+ const _chrMaj = _chrM ? _chrM[1] : '134';
74
+ const _chrFull = _chrM ? (_chrM[1] + '.' + _chrM[2]) : '134.0.6998.88';
75
+
69
76
  const CONFIG = {
70
77
  // Navigator
71
78
  userAgent: navigator.userAgent,
@@ -121,22 +128,22 @@ export const createDataDomeBypassScript = () => {
121
128
  rtt: 50 + Math.floor(stableRand(0, 50)),
122
129
  downlink: 10 + stableRand(0, 40),
123
130
 
124
- // Client Hints (CRITICAL for DataDome) - must match ua-ch.ts
131
+ // Client Hints - dynamically matched to actual Chrome UA (computed above)
125
132
  brands: [
126
- { brand: 'Google Chrome', version: '134' },
127
- { brand: 'Chromium', version: '134' },
133
+ { brand: 'Chromium', version: _chrMaj },
134
+ { brand: 'Google Chrome', version: _chrMaj },
128
135
  { brand: 'Not_A Brand', version: '24' }
129
136
  ],
130
137
  fullVersionList: [
131
- { brand: 'Google Chrome', version: '134.0.6998.88' },
132
- { brand: 'Chromium', version: '134.0.6998.88' },
138
+ { brand: 'Chromium', version: _chrFull },
139
+ { brand: 'Google Chrome', version: _chrFull },
133
140
  { brand: 'Not_A Brand', version: '24.0.0.0' }
134
141
  ],
135
142
  architecture: 'x86',
136
143
  bitness: '64',
137
144
  model: '',
138
145
  platformVersion: '15.0.0',
139
- uaFullVersion: '134.0.6998.88',
146
+ uaFullVersion: _chrFull,
140
147
  wow64: false,
141
148
  mobile: false,
142
149
  };
@@ -409,7 +416,7 @@ export const createDataDomeBypassScript = () => {
409
416
  let last = 0;
410
417
  performance.now = function() {
411
418
  let n = origNow();
412
- if (n <= last) n = last + 0.001 + Math.random() * 0.001;
419
+ if (n <= last) n = last + 0.001;
413
420
  last = n;
414
421
  return n;
415
422
  };
@@ -660,7 +667,8 @@ export const createDataDomeBypassScript = () => {
660
667
  rtt: CONFIG.rtt,
661
668
  downlink: CONFIG.downlink,
662
669
  saveData: false,
663
- type: 'wifi',
670
+ // NOTE: 'type' is NOT present on desktop Chrome (only Android exposes it).
671
+ // Setting type:'wifi' was a false signal detectable by fingerprinters.
664
672
  };
665
673
 
666
674
  for (const [k, v] of Object.entries(props)) {
@@ -871,7 +879,7 @@ export const createDataDomeBypassScript = () => {
871
879
 
872
880
  window.requestAnimationFrame = function(cb) {
873
881
  const id = nextId++;
874
- const jitter = Math.random() * 2;
882
+ const jitter = stableRand(0, 2);
875
883
  const realId = origRAF.call(this, (ts) => {
876
884
  pending.delete(id);
877
885
  cb(ts + jitter);
@@ -1081,7 +1089,7 @@ export const createDataDomeBypassScript = () => {
1081
1089
  window.setTimeout = function(cb, delay, ...args) {
1082
1090
  // Add variance to short delays (DataDome detection)
1083
1091
  if (delay !== undefined && delay < 100) {
1084
- delay = delay + Math.floor(Math.random() * 30);
1092
+ delay = delay + Math.floor(stableRand(0, 30));
1085
1093
  }
1086
1094
  return orig.call(this, cb, delay, ...args);
1087
1095
  };
@@ -1 +1 @@
1
- {"version":3,"file":"datadome-bypass.js","sourceRoot":"","sources":["../../../src/fingerprinting/fingerprint-overrides/datadome-bypass.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,MAAM,CAAC,MAAM,0BAA0B,GAAG,GAAW,EAAE;IACnD,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAspCL,CAAC;AACP,CAAC,CAAC"}
@@ -18,7 +18,7 @@ export { createClientRectSpoofingScript } from './client-rect-spoofing.js';
18
18
  export { createWebRTCSpoofingScript, createWebRTCDisableScript } from './webrtc-spoofing.js';
19
19
  export { createWebGPUSpoofingScript } from './webgpu-spoofing.js';
20
20
  export { createPlatformConsistencyScript, type PlatformConfig } from './platform-consistency.js';
21
- export { setupMouseMovementHumanization } from './mouse-humanization.js';
21
+ export { createMouseMovementHumanizationScript, setupMouseMovementHumanization } from './mouse-humanization.js';
22
22
  export { createRuntimeEnableBypassScript } from './runtime-enable-bypass.js';
23
23
  export { createFontSpoofingScript } from './font-spoofing.js';
24
24
  export { createPerformanceSpoofingScript } from './performance-spoofing.js';
@@ -32,6 +32,5 @@ export { createTimingConsistencyScript } from './timing-consistency.js';
32
32
  export { createKeyboardHumanizationScript, setupKeyboardHumanization, generateTypingDelays, createHumanTypingFunction } from './keyboard-humanization.js';
33
33
  export { createScrollHumanizationScript, setupScrollHumanization, humanScroll, humanScrollToElement, generateScrollPath } from './scroll-humanization.js';
34
34
  export { createDataDomeBypassScript } from './datadome-bypass.js';
35
- export { createCoalescedEventsSpoofingScript } from './coalesced-events-spoofing.js';
36
35
  export { createMediaCodecsSpoofingScript } from './media-codecs-spoofing.js';
37
36
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fingerprinting/fingerprint-overrides/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;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,OAAO,EAAE,8BAA8B,EAAE,MAAM,0BAA0B,CAAC;AAG1E,OAAO,EAAE,8BAA8B,EAAE,MAAM,2BAA2B,CAAC;AAC3E,OAAO,EAAE,8BAA8B,EAAE,MAAM,0BAA0B,CAAC;AAC1E,OAAO,EAAE,6BAA6B,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,EACH,gCAAgC,EAChC,yBAAyB,EACzB,oBAAoB,EACpB,yBAAyB,EAC5B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACH,8BAA8B,EAC9B,uBAAuB,EACvB,WAAW,EACX,oBAAoB,EACpB,kBAAkB,EACrB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,+BAA+B,EAAE,MAAM,4BAA4B,CAAC"}
@@ -19,7 +19,7 @@ export { createClientRectSpoofingScript } from './client-rect-spoofing.js';
19
19
  export { createWebRTCSpoofingScript, createWebRTCDisableScript } from './webrtc-spoofing.js';
20
20
  export { createWebGPUSpoofingScript } from './webgpu-spoofing.js';
21
21
  export { createPlatformConsistencyScript } from './platform-consistency.js';
22
- export { setupMouseMovementHumanization } from './mouse-humanization.js';
22
+ export { createMouseMovementHumanizationScript, setupMouseMovementHumanization } from './mouse-humanization.js';
23
23
  export { createRuntimeEnableBypassScript } from './runtime-enable-bypass.js';
24
24
  export { createFontSpoofingScript } from './font-spoofing.js';
25
25
  export { createPerformanceSpoofingScript } from './performance-spoofing.js';
@@ -36,6 +36,5 @@ export { createTimingConsistencyScript } from './timing-consistency.js';
36
36
  export { createKeyboardHumanizationScript, setupKeyboardHumanization, generateTypingDelays, createHumanTypingFunction } from './keyboard-humanization.js';
37
37
  export { createScrollHumanizationScript, setupScrollHumanization, humanScroll, humanScrollToElement, generateScrollPath } from './scroll-humanization.js';
38
38
  export { createDataDomeBypassScript } from './datadome-bypass.js';
39
- export { createCoalescedEventsSpoofingScript } from './coalesced-events-spoofing.js';
40
39
  export { createMediaCodecsSpoofingScript } from './media-codecs-spoofing.js';
41
40
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/fingerprinting/fingerprint-overrides/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,sCAAsC;AACtC,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,yBAAyB,EAAoB,MAAM,qBAAqB,CAAC;AAClF,OAAO,EAAE,oCAAoC,EAAE,MAAM,qBAAqB,CAAC;AAC3E,OAAO,EAAE,oCAAoC,EAAE,MAAM,wBAAwB,CAAC;AAC9E,OAAO,EAAE,8BAA8B,EAAE,MAAM,2BAA2B,CAAC;AAC3E,OAAO,EAAE,0BAA0B,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAC7F,OAAO,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,+BAA+B,EAAuB,MAAM,2BAA2B,CAAC;AACjG,OAAO,EAAE,8BAA8B,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,EAAE,+BAA+B,EAAE,MAAM,4BAA4B,CAAC;AAC7E,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,+BAA+B,EAAE,MAAM,2BAA2B,CAAC;AAC5E,OAAO,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,iCAAiC,EAA0B,MAAM,YAAY,CAAC;AAEvF,6CAA6C;AAC7C,OAAO,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAEtD,iDAAiD;AACjD,OAAO,EAAE,8BAA8B,EAAE,MAAM,0BAA0B,CAAC;AAE1E,wBAAwB;AACxB,OAAO,EAAE,8BAA8B,EAAE,MAAM,2BAA2B,CAAC;AAC3E,OAAO,EAAE,8BAA8B,EAAE,MAAM,0BAA0B,CAAC;A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E,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,iCAAiC,EAA0B,MAAM,YAAY,CAAC;AAEvF,6CAA6C;AAC7C,OAAO,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAEtD,iDAAiD;AACjD,OAAO,EAAE,8BAA8B,EAAE,MAAM,0BAA0B,CAAC;AAE1E,wBAAwB;AACxB,OAAO,EAAE,8BAA8B,EAAE,MAAM,2BAA2B,CAAC;AAC3E,OAAO,EAAE,8BAA8B,EAAE,MAAM,0BAA0B,CAAC;AAC1E,OAAO,EAAE,6BAA6B,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,EACH,gCAAgC,EAChC,yBAAyB,EACzB,oBAAoB,EACpB,yBAAyB,EAC5B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACH,8BAA8B,EAC9B,uBAAuB,EACvB,WAAW,EACX,oBAAoB,EACpB,kBAAkB,EACrB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,+BAA+B,EAAE,MAAM,4BAA4B,CAAC"}
@@ -38,8 +38,16 @@ export declare const createKeyboardHumanizationScript: () => string;
38
38
  */
39
39
  export declare const createHumanTypingFunction: (client: unknown, config?: Partial<KeyboardConfig>) => Promise<(text: string) => Promise<void>>;
40
40
  /**
41
- * Setup keyboard humanization at CDP level
41
+ * Setup keyboard humanization at CDP level.
42
+ *
43
+ * Pass `useNativeStealth: true` when running on the patched anti-detect Cromite
44
+ * build — the C++ side already handles keyboard event mechanics (proper `code` /
45
+ * `key` / `keyCode` / pressure / coalesced events), and a JS-side `KeyboardEvent`
46
+ * constructor override would only add detectable prototype tampering on top.
47
+ * In that mode this function no-ops.
42
48
  */
43
- export declare const setupKeyboardHumanization: (client: unknown) => Promise<void>;
49
+ export declare const setupKeyboardHumanization: (client: unknown, options?: {
50
+ useNativeStealth?: boolean;
51
+ }) => Promise<void>;
44
52
  export {};
45
53
  //# sourceMappingURL=keyboard-humanization.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"keyboard-humanization.d.ts","sourceRoot":"","sources":["../../../src/fingerprinting/fingerprint-overrides/keyboard-humanization.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH;;GAEG;AACH,UAAU,cAAc;IACpB,0CAA0C;IAC1C,SAAS,EAAE,MAAM,CAAC;IAClB,8BAA8B;IAC9B,aAAa,EAAE,MAAM,CAAC;IACtB,gDAAgD;IAChD,iBAAiB,EAAE,MAAM,CAAC;IAC1B,gDAAgD;IAChD,eAAe,EAAE,MAAM,CAAC;IACxB,iCAAiC;IACjC,UAAU,EAAE,MAAM,CAAC;CACtB;AAqBD;;GAEG;AACH,eAAO,MAAM,oBAAoB,SACvB,MAAM,WACJ,OAAO,CAAC,cAAc,CAAC,KAChC,MAAM,EAiDR,CAAC;AA2BF;;GAEG;AACH,eAAO,MAAM,gCAAgC,QAAO,MAwGnD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,yBAAyB,WAC1B,OAAO,WACP,OAAO,CAAC,cAAc,CAAC,KAChC,OAAO,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CA+DzC,CAAC;AAOF;;GAEG;AACH,eAAO,MAAM,yBAAyB,WAAkB,OAAO,KAAG,OAAO,CAAC,IAAI,CAc7E,CAAC"}
1
+ {"version":3,"file":"keyboard-humanization.d.ts","sourceRoot":"","sources":["../../../src/fingerprinting/fingerprint-overrides/keyboard-humanization.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH;;GAEG;AACH,UAAU,cAAc;IACpB,0CAA0C;IAC1C,SAAS,EAAE,MAAM,CAAC;IAClB,8BAA8B;IAC9B,aAAa,EAAE,MAAM,CAAC;IACtB,gDAAgD;IAChD,iBAAiB,EAAE,MAAM,CAAC;IAC1B,gDAAgD;IAChD,eAAe,EAAE,MAAM,CAAC;IACxB,iCAAiC;IACjC,UAAU,EAAE,MAAM,CAAC;CACtB;AAqBD;;GAEG;AACH,eAAO,MAAM,oBAAoB,SACvB,MAAM,WACJ,OAAO,CAAC,cAAc,CAAC,KAChC,MAAM,EAiDR,CAAC;AA2BF;;GAEG;AACH,eAAO,MAAM,gCAAgC,QAAO,MAwGnD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,yBAAyB,WAC1B,OAAO,WACP,OAAO,CAAC,cAAc,CAAC,KAChC,OAAO,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CA+DzC,CAAC;AAOF;;;;;;;;GAQG;AACH,eAAO,MAAM,yBAAyB,WAC1B,OAAO,YACL;IAAE,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAAE,KACzC,OAAO,CAAC,IAAI,CAiBd,CAAC"}
@@ -253,9 +253,18 @@ export const createHumanTypingFunction = async (client, config = {}) => {
253
253
  */
254
254
  const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms));
255
255
  /**
256
- * Setup keyboard humanization at CDP level
256
+ * Setup keyboard humanization at CDP level.
257
+ *
258
+ * Pass `useNativeStealth: true` when running on the patched anti-detect Cromite
259
+ * build — the C++ side already handles keyboard event mechanics (proper `code` /
260
+ * `key` / `keyCode` / pressure / coalesced events), and a JS-side `KeyboardEvent`
261
+ * constructor override would only add detectable prototype tampering on top.
262
+ * In that mode this function no-ops.
257
263
  */
258
- export const setupKeyboardHumanization = async (client) => {
264
+ export const setupKeyboardHumanization = async (client, options) => {
265
+ if (options?.useNativeStealth) {
266
+ return;
267
+ }
259
268
  // Inject the keyboard humanization script
260
269
  // NOTE: Using Page.addScriptToEvaluateOnNewDocument instead of Runtime.evaluate to avoid CDP detection
261
270
  const inputClient = client;
@@ -1 +1 @@
1
- {"version":3,"file":"keyboard-humanization.js","sourceRoot":"","sources":["../../../src/fingerprinting/fingerprint-overrides/keyboard-humanization.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAkBH,M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AG,CAAC,GAAG,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC;gBAChE,MAAM,WAAW,CAAC,gBAAgB,CAAC;oBAC/B,IAAI,EAAE,OAAO;oBACb,GAAG,EAAE,OAAO;oBACZ,IAAI,EAAE,WAAW;iBACpB,CAAC,CAAC;YACP,CAAC;YAED,uBAAuB;YACvB,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACtB,MAAM,KAAK,CAAC,KAAK,CAAC,CAAC;YACvB,CAAC;QACL,CAAC;IACL,CAAC,CAAC;AACN,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,KAAK,GAAG,CAAC,EAAU,EAAiB,EAAE,CAAC,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AAE7F;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,KAAK,EAAE,MAAe,EAAiB,EAAE;IAC9E,0CAA0C;IAC1C,uGAAuG;IACvG,MAAM,WAAW,GAAG,MAInB,CAAC;IAEF,2EAA2E;IAC3E,6CAA6C;IAC7C,MAAM,WAAW,CAAC,IAAI,CAAC,gCAAgC,CAAC;QACpD,MAAM,EAAE,gCAAgC,EAAE;KAC7C,CAAC,CAAC;AACP,CAAC,CAAC"}
1
+ {"version":3,"file":"keyboard-humanization.js","sourceRoot":"","sources":["../../../src/fingerprinting/fingerprint-overrides/keyboard-humanization.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAkBH,MAAM,cAAc,GAAmB;IACnC,SAAS,EAAE,EAAE;IACb,aAAa,EAAE,EAAE;IACjB,iBAAiB,EAAE,EAAE;IACrB,eAAe,EAAE,GAAG;IACpB,UAAU,EAAE,EAAE;CACjB,CAAC;AAEF;;GAEG;AACH,MAAM,eAAe,GAAG;IACpB,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EA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B,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACtB,MAAM,KAAK,CAAC,KAAK,CAAC,CAAC;YACvB,CAAC;QACL,CAAC;IACL,CAAC,CAAC;AACN,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,KAAK,GAAG,CAAC,EAAU,EAAiB,EAAE,CAAC,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AAE7F;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,KAAK,EAC1C,MAAe,EACf,OAAwC,EAC3B,EAAE;IACf,IAAI,OAAO,EAAE,gBAAgB,EAAE,CAAC;QAC5B,OAAO;IACX,CAAC;IACD,0CAA0C;IAC1C,uGAAuG;IACvG,MAAM,WAAW,GAAG,MAInB,CAAC;IAEF,2EAA2E;IAC3E,6CAA6C;IAC7C,MAAM,WAAW,CAAC,IAAI,CAAC,gCAAgC,CAAC;QACpD,MAAM,EAAE,gCAAgC,EAAE;KAC7C,CAAC,CAAC;AACP,CAAC,CAAC"}
@@ -1,6 +1,24 @@
1
1
  /**
2
2
  * Locale Spoofing
3
- * Ensures consistent Windows-style locale formatting for dates, numbers, and currencies
3
+ *
4
+ * Ensures the resolved locale reaches every observable surface that Chrome's own
5
+ * ICU/Intl defaults don't cover under CDP overrides. Most of the heavy lifting is done
6
+ * by `Emulation.setLocaleOverride` (CDP path) and `--lang` (process startup), so this
7
+ * script is deliberately minimal: it just normalizes the timezone used by Intl.DateTimeFormat
8
+ * when the caller passes partial options, and forwards the locale when Date.prototype
9
+ * toLocale* methods are called without explicit locales.
10
+ *
11
+ * It deliberately does NOT override navigator.language / navigator.languages here.
12
+ * Those are driven by the C++ patch (`--fingerprint-accept-language`, anti-detect path)
13
+ * or by CDP Network.setExtraHTTPHeaders + setLocaleOverride (stock Chrome path). Double-
14
+ * overriding them from JS is a detection vector: a call order mismatch would leak
15
+ * the "before" value in the property descriptor.
4
16
  */
5
- export declare const createLocaleSpoofingScript: () => string;
17
+ export interface LocaleSpoofingOptions {
18
+ /** BCP-47 locale tag (e.g. 'ko-KR'). */
19
+ locale: string;
20
+ /** Accept-Language list with q-values (e.g. 'ko-KR,ko;q=0.9,en;q=0.8'). */
21
+ languages: string;
22
+ }
23
+ export declare const createLocaleSpoofingScript: (options: LocaleSpoofingOptions) => string;
6
24
  //# sourceMappingURL=locale-spoofing.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"locale-spoofing.d.ts","sourceRoot":"","sources":["../../../src/fingerprinting/fingerprint-overrides/locale-spoofing.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,MAAM,0BAA0B,QAAO,MAuS7C,CAAC"}
1
+ {"version":3,"file":"locale-spoofing.d.ts","sourceRoot":"","sources":["../../../src/fingerprinting/fingerprint-overrides/locale-spoofing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,WAAW,qBAAqB;IAClC,wCAAwC;IACxC,MAAM,EAAE,MAAM,CAAC;IACf,2EAA2E;IAC3E,SAAS,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,0BAA0B,YAAa,qBAAqB,KAAG,MAkF3E,CAAC"}
@@ -1,294 +1,91 @@
1
1
  /**
2
2
  * Locale Spoofing
3
- * Ensures consistent Windows-style locale formatting for dates, numbers, and currencies
3
+ *
4
+ * Ensures the resolved locale reaches every observable surface that Chrome's own
5
+ * ICU/Intl defaults don't cover under CDP overrides. Most of the heavy lifting is done
6
+ * by `Emulation.setLocaleOverride` (CDP path) and `--lang` (process startup), so this
7
+ * script is deliberately minimal: it just normalizes the timezone used by Intl.DateTimeFormat
8
+ * when the caller passes partial options, and forwards the locale when Date.prototype
9
+ * toLocale* methods are called without explicit locales.
10
+ *
11
+ * It deliberately does NOT override navigator.language / navigator.languages here.
12
+ * Those are driven by the C++ patch (`--fingerprint-accept-language`, anti-detect path)
13
+ * or by CDP Network.setExtraHTTPHeaders + setLocaleOverride (stock Chrome path). Double-
14
+ * overriding them from JS is a detection vector: a call order mismatch would leak
15
+ * the "before" value in the property descriptor.
4
16
  */
5
- export const createLocaleSpoofingScript = () => {
17
+ export const createLocaleSpoofingScript = (options) => {
18
+ // Escape single quotes in user-provided strings before embedding in script literals.
19
+ const locale = options.locale.replace(/'/g, "\\'");
20
+ const langList = JSON.stringify(options.languages.split(',').map(l => l.split(';')[0].trim()).filter(Boolean));
6
21
  return `
7
22
  (() => {
8
23
  'use strict';
9
-
10
- // Locale Spoofing for 2025 - Windows-consistent formatting
24
+
25
+ const SPOOF_LOCALE = '${locale}';
26
+ const SPOOF_LANG_LIST = ${langList};
27
+
11
28
  const spoofLocale = () => {
12
- // Platform-specific locale configurations
13
- const platform = navigator.platform || 'Win32';
14
-
15
- // Windows-specific locale settings
16
- const windowsLocaleConfig = {
17
- dateFormat: {
18
- weekday: 'long',
19
- year: 'numeric',
20
- month: 'long',
21
- day: 'numeric'
22
- },
23
- timeFormat: {
24
- hour: '2-digit',
25
- minute: '2-digit',
26
- second: '2-digit',
27
- hour12: true
28
- },
29
- numberFormat: {
30
- minimumFractionDigits: 0,
31
- maximumFractionDigits: 3,
32
- useGrouping: true
33
- },
34
- currencyFormat: {
35
- style: 'currency',
36
- currency: 'USD',
37
- currencyDisplay: 'symbol'
38
- }
39
- };
40
-
41
- // Override Intl.DateTimeFormat to use Windows-consistent formatting
42
- // CRITICAL: Store reference BEFORE override and use recursion guard
29
+ // Intl.DateTimeFormat forward the current timezone when the caller doesn't specify one
30
+ // (matches real-browser behavior where resolvedOptions().timeZone is always populated).
43
31
  const OriginalDateTimeFormat = Intl.DateTimeFormat;
44
- let isCreatingDateTimeFormat = false; // Recursion guard
32
+ let isCreatingDateTimeFormat = false;
45
33
  let cachedTimeZone = 'UTC';
46
34
  try {
47
35
  cachedTimeZone = new OriginalDateTimeFormat().resolvedOptions().timeZone;
48
- } catch (e) {
49
- // Fallback to UTC if timezone detection fails
50
- }
51
-
36
+ } catch (e) {}
37
+
52
38
  Intl.DateTimeFormat = function(locales, options) {
53
- // CRITICAL: Recursion guard - if we're already inside this function, use original directly
54
39
  if (isCreatingDateTimeFormat) {
55
40
  return Reflect.construct(OriginalDateTimeFormat, [locales, options], OriginalDateTimeFormat);
56
41
  }
57
-
58
42
  isCreatingDateTimeFormat = true;
59
43
  try {
60
- // Ensure Windows-like date formatting regardless of actual locale
61
- const windowsOptions = Object.assign({}, windowsLocaleConfig.dateFormat, options);
62
-
63
- // Force specific Windows locale patterns
64
- if (platform === 'Win32' || !platform.includes('Linux')) {
65
- if (!options || !options.timeZone) {
66
- windowsOptions.timeZone = cachedTimeZone;
67
- }
44
+ const windowsOptions = Object.assign({}, options);
45
+ if (!windowsOptions.timeZone) {
46
+ windowsOptions.timeZone = cachedTimeZone;
68
47
  }
69
-
70
- // Use Reflect.construct to properly create instance with original constructor
71
- const formatter = Reflect.construct(OriginalDateTimeFormat, [locales, windowsOptions], OriginalDateTimeFormat);
72
-
73
- return formatter;
48
+ return Reflect.construct(OriginalDateTimeFormat, [locales, windowsOptions], OriginalDateTimeFormat);
74
49
  } finally {
75
50
  isCreatingDateTimeFormat = false;
76
51
  }
77
52
  };
78
-
79
- // Override Intl.NumberFormat for Windows-consistent number formatting
80
- const OriginalNumberFormat = Intl.NumberFormat;
81
- let isCreatingNumberFormat = false; // Recursion guard
82
-
83
- Intl.NumberFormat = function(locales, options) {
84
- // CRITICAL: Recursion guard
85
- if (isCreatingNumberFormat) {
86
- return Reflect.construct(OriginalNumberFormat, [locales, options], OriginalNumberFormat);
87
- }
88
-
89
- isCreatingNumberFormat = true;
90
- try {
91
- const windowsOptions = Object.assign({}, windowsLocaleConfig.numberFormat, options);
92
-
93
- // Windows-specific number formatting
94
- if (platform === 'Win32') {
95
- windowsOptions.useGrouping = true;
96
- if (options && options.style === 'currency') {
97
- Object.assign(windowsOptions, windowsLocaleConfig.currencyFormat, options);
98
- }
99
- }
100
-
101
- // Use Reflect.construct to properly create instance with original constructor
102
- return Reflect.construct(OriginalNumberFormat, [locales, windowsOptions], OriginalNumberFormat);
103
- } finally {
104
- isCreatingNumberFormat = false;
105
- }
106
- };
107
-
108
- // Override Date.prototype methods for consistent formatting
53
+
54
+ // Date.prototype.toLocale* when called without a locale, forward the spoofed one
55
+ // so the output matches what navigator.language advertises. Passing a locale explicitly
56
+ // still wins because ECMA-402 spec behavior.
109
57
  const originalToLocaleString = Date.prototype.toLocaleString;
110
58
  const originalToLocaleDateString = Date.prototype.toLocaleDateString;
111
59
  const originalToLocaleTimeString = Date.prototype.toLocaleTimeString;
112
-
60
+
113
61
  Date.prototype.toLocaleString = function(locales, options) {
114
- const windowsOptions = Object.assign({}, windowsLocaleConfig.dateFormat, windowsLocaleConfig.timeFormat, options);
115
- return originalToLocaleString.call(this, locales || 'en-US', windowsOptions);
62
+ return originalToLocaleString.call(this, locales || SPOOF_LOCALE, options);
116
63
  };
117
-
118
64
  Date.prototype.toLocaleDateString = function(locales, options) {
119
- const windowsOptions = Object.assign({}, windowsLocaleConfig.dateFormat, options);
120
- return originalToLocaleDateString.call(this, locales || 'en-US', windowsOptions);
65
+ return originalToLocaleDateString.call(this, locales || SPOOF_LOCALE, options);
121
66
  };
122
-
123
67
  Date.prototype.toLocaleTimeString = function(locales, options) {
124
- const windowsOptions = Object.assign({}, windowsLocaleConfig.timeFormat, options);
125
- return originalToLocaleTimeString.call(this, locales || 'en-US', windowsOptions);
68
+ return originalToLocaleTimeString.call(this, locales || SPOOF_LOCALE, options);
126
69
  };
127
-
128
- // Override Number.prototype methods for consistent formatting
70
+
71
+ // Number.prototype.toLocaleString same forward-on-omit behavior.
129
72
  const originalNumberToLocaleString = Number.prototype.toLocaleString;
130
73
  Number.prototype.toLocaleString = function(locales, options) {
131
- let windowsOptions = Object.assign({}, windowsLocaleConfig.numberFormat, options);
132
-
133
- if (options && options.style === 'currency') {
134
- windowsOptions = Object.assign({}, windowsLocaleConfig.currencyFormat, options);
135
- }
136
-
137
- return originalNumberToLocaleString.call(this, locales || 'en-US', windowsOptions);
138
- };
139
-
140
- // Spoof timezone-related methods for consistency
141
- const originalGetTimezoneOffset = Date.prototype.getTimezoneOffset;
142
- // Cache winter/summer offsets at init time to prevent recursion
143
- let cachedWinterOffset = null;
144
- let cachedSummerOffset = null;
145
- try {
146
- const now = new Date();
147
- cachedWinterOffset = originalGetTimezoneOffset.call(new Date(now.getFullYear(), 0, 1));
148
- cachedSummerOffset = originalGetTimezoneOffset.call(new Date(now.getFullYear(), 6, 1));
149
- } catch (e) {
150
- // Fallback - no DST adjustment
151
- }
152
-
153
- Date.prototype.getTimezoneOffset = function() {
154
- const offset = originalGetTimezoneOffset.call(this);
155
-
156
- // Ensure timezone offset is reported consistently
157
- // Windows tends to handle DST slightly differently
158
- if (platform === 'Win32' && cachedWinterOffset !== null && cachedSummerOffset !== null) {
159
- // Apply Windows-style DST calculation if needed
160
- if (cachedWinterOffset !== cachedSummerOffset) {
161
- const isDST = offset === Math.min(cachedWinterOffset, cachedSummerOffset);
162
- return isDST ? cachedSummerOffset : cachedWinterOffset;
163
- }
164
- }
165
-
166
- return offset;
74
+ return originalNumberToLocaleString.call(this, locales || SPOOF_LOCALE, options);
167
75
  };
168
-
169
- // Override Intl.Collator for Windows-consistent string comparison
170
- if (typeof Intl.Collator !== 'undefined') {
171
- const OriginalCollator = Intl.Collator;
172
- let isCreatingCollator = false;
173
- Intl.Collator = function(locales, options) {
174
- if (isCreatingCollator) {
175
- return Reflect.construct(OriginalCollator, [locales, options], OriginalCollator);
176
- }
177
- isCreatingCollator = true;
178
- try {
179
- const windowsOptions = Object.assign({
180
- sensitivity: 'base',
181
- usage: 'sort',
182
- caseFirst: 'upper'
183
- }, options);
184
- return Reflect.construct(OriginalCollator, [locales, windowsOptions], OriginalCollator);
185
- } finally {
186
- isCreatingCollator = false;
187
- }
188
- };
189
- }
190
-
191
- // Override Intl.PluralRules for consistency
192
- if (typeof Intl.PluralRules !== 'undefined') {
193
- const OriginalPluralRules = Intl.PluralRules;
194
- let isCreatingPluralRules = false;
195
- Intl.PluralRules = function(locales, options) {
196
- if (isCreatingPluralRules) {
197
- return Reflect.construct(OriginalPluralRules, [locales, options], OriginalPluralRules);
198
- }
199
- isCreatingPluralRules = true;
200
- try {
201
- return Reflect.construct(OriginalPluralRules, [locales || 'en-US', options], OriginalPluralRules);
202
- } finally {
203
- isCreatingPluralRules = false;
204
- }
205
- };
206
- }
207
-
208
- // Override Intl.RelativeTimeFormat if available
209
- if (typeof Intl.RelativeTimeFormat !== 'undefined') {
210
- const OriginalRelativeTimeFormat = Intl.RelativeTimeFormat;
211
- let isCreatingRelativeTimeFormat = false;
212
- Intl.RelativeTimeFormat = function(locales, options) {
213
- if (isCreatingRelativeTimeFormat) {
214
- return Reflect.construct(OriginalRelativeTimeFormat, [locales, options], OriginalRelativeTimeFormat);
215
- }
216
- isCreatingRelativeTimeFormat = true;
217
- try {
218
- const windowsOptions = Object.assign({
219
- style: 'long',
220
- numeric: 'auto'
221
- }, options);
222
- return Reflect.construct(OriginalRelativeTimeFormat, [locales || 'en-US', windowsOptions], OriginalRelativeTimeFormat);
223
- } finally {
224
- isCreatingRelativeTimeFormat = false;
225
- }
226
- };
227
- }
228
-
229
- // Spoof locale-specific string methods
76
+
77
+ // String.prototype.localeCompare same.
230
78
  const originalLocaleCompare = String.prototype.localeCompare;
231
79
  String.prototype.localeCompare = function(compareString, locales, options) {
232
- const windowsOptions = Object.assign({
233
- sensitivity: 'base',
234
- caseFirst: 'upper'
235
- }, options);
236
-
237
- return originalLocaleCompare.call(this, compareString, locales || 'en-US', windowsOptions);
80
+ return originalLocaleCompare.call(this, compareString, locales || SPOOF_LOCALE, options);
238
81
  };
239
-
240
- // Helper to check if property can be redefined
241
- const canRedefineProperty = (obj, prop) => {
242
- try {
243
- const descriptor = Object.getOwnPropertyDescriptor(obj, prop);
244
- return !descriptor || descriptor.configurable !== false;
245
- } catch (e) {
246
- return false;
247
- }
248
- };
249
-
250
- // IMPORTANT: Cache original values BEFORE any override to prevent infinite recursion
251
- const originalLanguage = navigator.language;
252
- const originalLanguages = navigator.languages ? [...navigator.languages] : ['en-US'];
253
-
254
- // Ensure consistent navigator.language reporting
255
- if (canRedefineProperty(navigator, 'language')) {
256
- try {
257
- Object.defineProperty(navigator, 'language', {
258
- get: function() {
259
- // Use cached value to prevent infinite recursion
260
- return platform === 'Win32' ? 'en-US' : originalLanguage;
261
- },
262
- configurable: true // Allow other scripts to modify if needed
263
- });
264
- } catch (e) {
265
- // Property already defined, skip
266
- }
267
- }
268
-
269
- if (canRedefineProperty(navigator, 'languages')) {
270
- try {
271
- Object.defineProperty(navigator, 'languages', {
272
- get: function() {
273
- // Use cached value to prevent infinite recursion
274
- if (platform === 'Win32') {
275
- return ['en-US', 'en'];
276
- }
277
- return originalLanguages;
278
- },
279
- configurable: true // Allow other scripts to modify if needed
280
- });
281
- } catch (e) {
282
- // Property already defined, skip
283
- }
284
- }
285
82
  };
286
-
83
+
287
84
  const DEBUG_PREFIX = '[CDP-FP-DEBUG]';
288
85
  const ERROR_PREFIX = '[CDP-FP-ERROR]';
289
-
86
+
290
87
  try {
291
- console.log(DEBUG_PREFIX, 'Starting locale spoofing...');
88
+ console.log(DEBUG_PREFIX, 'Starting locale spoofing...', { locale: SPOOF_LOCALE, languages: SPOOF_LANG_LIST });
292
89
  spoofLocale();
293
90
  console.log(DEBUG_PREFIX, '✓ Locale spoofing applied');
294
91
  } catch (e) {
@@ -1 +1 @@
1
- {"version":3,"file":"locale-spoofing.js","sourceRoot":"","sources":["../../../src/fingerprinting/fingerprint-overrides/locale-spoofing.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,CAAC,MAAM,0BAA0B,GAAG,GAAW,EAAE;IACnD,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqSV,CAAC;AACF,CAAC,CAAC"}
1
+ {"version":3,"file":"locale-spoofing.js","sourceRoot":"","sources":["../../../src/fingerprinting/fingerprint-overrides/locale-spoofing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AASH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,OAA8B,EAAU,EAAE;IACjF,qFAAqF;IACrF,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACnD,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAC3B,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAChF,CAAC;IACF,OAAO;;;;4BAIiB,MAAM;8BACJ,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsErC,CAAC;AACF,CAAC,CAAC"}
@@ -3,5 +3,16 @@
3
3
  * Generates bezier curve movements instead of straight lines
4
4
  * Stores the utility in the __stealth store for internal use only
5
5
  */
6
- export declare const setupMouseMovementHumanization: (client: any) => Promise<void>;
6
+ /**
7
+ * Returns the browser-context script that installs the bezier-curve mouse
8
+ * utility on __stealth.humanizeMouse. Included in the main bundled injection
9
+ * so it counts as only ONE addScriptToEvaluateOnNewDocument call.
10
+ */
11
+ export declare const createMouseMovementHumanizationScript: () => string;
12
+ /**
13
+ * @deprecated The browser-context script is now bundled via
14
+ * createMouseMovementHumanizationScript(). This function is kept only as a
15
+ * no-op so callers that haven't been updated don't break at runtime.
16
+ */
17
+ export declare const setupMouseMovementHumanization: (_client: any) => Promise<void>;
7
18
  //# sourceMappingURL=mouse-humanization.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mouse-humanization.d.ts","sourceRoot":"","sources":["../../../src/fingerprinting/fingerprint-overrides/mouse-humanization.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,eAAO,MAAM,8BAA8B,WAAkB,GAAG,KAAG,OAAO,CAAC,IAAI,CAkE9E,CAAC"}
1
+ {"version":3,"file":"mouse-humanization.d.ts","sourceRoot":"","sources":["../../../src/fingerprinting/fingerprint-overrides/mouse-humanization.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;GAIG;AACH,eAAO,MAAM,qCAAqC,QAAO,MAyDxD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,8BAA8B,YAAmB,GAAG,KAAG,OAAO,CAAC,IAAI,CAG/E,CAAC"}