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.
- package/README.md +13 -0
- package/dist/browser-controller.d.ts.map +1 -1
- package/dist/browser-controller.js +57 -2
- package/dist/browser-controller.js.map +1 -1
- package/dist/browser-plugin.d.ts +49 -0
- package/dist/browser-plugin.d.ts.map +1 -1
- package/dist/browser-plugin.js +103 -1
- package/dist/browser-plugin.js.map +1 -1
- package/dist/browser-process/anti-detect-browser.d.ts +56 -0
- package/dist/browser-process/anti-detect-browser.d.ts.map +1 -0
- package/dist/browser-process/anti-detect-browser.js +142 -0
- package/dist/browser-process/anti-detect-browser.js.map +1 -0
- package/dist/browser-process/anti-detect-config.d.ts +102 -0
- package/dist/browser-process/anti-detect-config.d.ts.map +1 -0
- package/dist/browser-process/anti-detect-config.js +328 -0
- package/dist/browser-process/anti-detect-config.js.map +1 -0
- package/dist/browser-process/browser.d.ts +26 -0
- package/dist/browser-process/browser.d.ts.map +1 -1
- package/dist/browser-process/browser.js +115 -6
- package/dist/browser-process/browser.js.map +1 -1
- package/dist/browser-process/get-chrome-executable.d.ts +7 -0
- package/dist/browser-process/get-chrome-executable.d.ts.map +1 -1
- package/dist/browser-process/get-chrome-executable.js +42 -0
- package/dist/browser-process/get-chrome-executable.js.map +1 -1
- package/dist/browser-process/index.d.ts +4 -1
- package/dist/browser-process/index.d.ts.map +1 -1
- package/dist/browser-process/index.js +3 -1
- package/dist/browser-process/index.js.map +1 -1
- package/dist/crawler.d.ts +17 -0
- package/dist/crawler.d.ts.map +1 -1
- package/dist/crawler.js +5 -2
- package/dist/crawler.js.map +1 -1
- package/dist/fingerprinting/fingerprint-injector.d.ts +54 -0
- package/dist/fingerprinting/fingerprint-injector.d.ts.map +1 -1
- package/dist/fingerprinting/fingerprint-injector.js +207 -58
- package/dist/fingerprinting/fingerprint-injector.js.map +1 -1
- package/dist/fingerprinting/fingerprint-overrides/audio-spoofing.d.ts.map +1 -1
- package/dist/fingerprinting/fingerprint-overrides/audio-spoofing.js +16 -0
- package/dist/fingerprinting/fingerprint-overrides/audio-spoofing.js.map +1 -1
- package/dist/fingerprinting/fingerprint-overrides/cdp-detection-bypass.d.ts.map +1 -1
- package/dist/fingerprinting/fingerprint-overrides/cdp-detection-bypass.js +3 -2
- package/dist/fingerprinting/fingerprint-overrides/cdp-detection-bypass.js.map +1 -1
- package/dist/fingerprinting/fingerprint-overrides/datadome-bypass.d.ts.map +1 -1
- package/dist/fingerprinting/fingerprint-overrides/datadome-bypass.js +18 -10
- package/dist/fingerprinting/fingerprint-overrides/datadome-bypass.js.map +1 -1
- package/dist/fingerprinting/fingerprint-overrides/index.d.ts +1 -2
- package/dist/fingerprinting/fingerprint-overrides/index.d.ts.map +1 -1
- package/dist/fingerprinting/fingerprint-overrides/index.js +1 -2
- package/dist/fingerprinting/fingerprint-overrides/index.js.map +1 -1
- package/dist/fingerprinting/fingerprint-overrides/keyboard-humanization.d.ts +10 -2
- package/dist/fingerprinting/fingerprint-overrides/keyboard-humanization.d.ts.map +1 -1
- package/dist/fingerprinting/fingerprint-overrides/keyboard-humanization.js +11 -2
- package/dist/fingerprinting/fingerprint-overrides/keyboard-humanization.js.map +1 -1
- package/dist/fingerprinting/fingerprint-overrides/locale-spoofing.d.ts +20 -2
- package/dist/fingerprinting/fingerprint-overrides/locale-spoofing.d.ts.map +1 -1
- package/dist/fingerprinting/fingerprint-overrides/locale-spoofing.js +47 -250
- package/dist/fingerprinting/fingerprint-overrides/locale-spoofing.js.map +1 -1
- package/dist/fingerprinting/fingerprint-overrides/mouse-humanization.d.ts +12 -1
- package/dist/fingerprinting/fingerprint-overrides/mouse-humanization.d.ts.map +1 -1
- package/dist/fingerprinting/fingerprint-overrides/mouse-humanization.js +27 -22
- package/dist/fingerprinting/fingerprint-overrides/mouse-humanization.js.map +1 -1
- package/dist/fingerprinting/fingerprint-overrides/platform-consistency.d.ts.map +1 -1
- package/dist/fingerprinting/fingerprint-overrides/platform-consistency.js +86 -28
- package/dist/fingerprinting/fingerprint-overrides/platform-consistency.js.map +1 -1
- package/dist/fingerprinting/fingerprint-overrides/scroll-humanization.d.ts +9 -2
- package/dist/fingerprinting/fingerprint-overrides/scroll-humanization.d.ts.map +1 -1
- package/dist/fingerprinting/fingerprint-overrides/scroll-humanization.js +10 -2
- package/dist/fingerprinting/fingerprint-overrides/scroll-humanization.js.map +1 -1
- package/dist/fingerprinting/fingerprint-overrides/stealth-script.d.ts.map +1 -1
- package/dist/fingerprinting/fingerprint-overrides/stealth-script.js +165 -33
- package/dist/fingerprinting/fingerprint-overrides/stealth-script.js.map +1 -1
- package/dist/fingerprinting/fingerprint-overrides/storage-consistency.d.ts.map +1 -1
- package/dist/fingerprinting/fingerprint-overrides/storage-consistency.js +10 -8
- package/dist/fingerprinting/fingerprint-overrides/storage-consistency.js.map +1 -1
- package/dist/fingerprinting/fingerprint-overrides/timing-consistency.d.ts.map +1 -1
- package/dist/fingerprinting/fingerprint-overrides/timing-consistency.js +9 -7
- package/dist/fingerprinting/fingerprint-overrides/timing-consistency.js.map +1 -1
- package/dist/fingerprinting/fingerprint-overrides/ua-ch.js +6 -6
- package/dist/fingerprinting/fingerprint-overrides/utils.d.ts.map +1 -1
- package/dist/fingerprinting/fingerprint-overrides/utils.js +44 -1
- package/dist/fingerprinting/fingerprint-overrides/utils.js.map +1 -1
- package/dist/fingerprinting/fingerprint-overrides/webgl-spoofing.d.ts.map +1 -1
- package/dist/fingerprinting/fingerprint-overrides/webgl-spoofing.js +43 -1
- package/dist/fingerprinting/fingerprint-overrides/webgl-spoofing.js.map +1 -1
- package/dist/fingerprinting/fingerprint-overrides/webgpu-spoofing.d.ts.map +1 -1
- package/dist/fingerprinting/fingerprint-overrides/webgpu-spoofing.js +9 -1
- package/dist/fingerprinting/fingerprint-overrides/webgpu-spoofing.js.map +1 -1
- package/dist/fingerprinting/fingerprint-overrides/webrtc-spoofing.d.ts.map +1 -1
- package/dist/fingerprinting/fingerprint-overrides/webrtc-spoofing.js +14 -3
- package/dist/fingerprinting/fingerprint-overrides/webrtc-spoofing.js.map +1 -1
- package/dist/fingerprinting/locale-resolver.d.ts +41 -0
- package/dist/fingerprinting/locale-resolver.d.ts.map +1 -0
- package/dist/fingerprinting/locale-resolver.js +155 -0
- package/dist/fingerprinting/locale-resolver.js.map +1 -0
- package/dist/fingerprinting/non-apify-fingerprint-generator.d.ts +32 -0
- package/dist/fingerprinting/non-apify-fingerprint-generator.d.ts.map +1 -0
- package/dist/fingerprinting/non-apify-fingerprint-generator.js +480 -0
- package/dist/fingerprinting/non-apify-fingerprint-generator.js.map +1 -0
- package/dist/keyboard-layout.d.ts +45 -0
- package/dist/keyboard-layout.d.ts.map +1 -0
- package/dist/keyboard-layout.js +162 -0
- package/dist/keyboard-layout.js.map +1 -0
- package/dist/page.d.ts +18 -0
- package/dist/page.d.ts.map +1 -1
- package/dist/page.js +96 -6
- package/dist/page.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +6 -1
- package/dist/fingerprinting/fingerprint-overrides/coalesced-events-spoofing.d.ts +0 -10
- package/dist/fingerprinting/fingerprint-overrides/coalesced-events-spoofing.d.ts.map +0 -1
- package/dist/fingerprinting/fingerprint-overrides/coalesced-events-spoofing.js +0 -210
- package/dist/fingerprinting/fingerprint-overrides/coalesced-events-spoofing.js.map +0 -1
|
@@ -3,17 +3,19 @@
|
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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 const createMouseMovementHumanizationScript = () => `
|
|
10
12
|
(() => {
|
|
11
13
|
'use strict';
|
|
12
14
|
|
|
13
15
|
const _s = typeof __stealth !== 'undefined' ? __stealth : {};
|
|
14
16
|
|
|
15
|
-
//
|
|
16
|
-
const
|
|
17
|
+
// Re-use centralized helpers when available; local fallback for safety.
|
|
18
|
+
const _createRNG = _s.createRNG || ((seed) => {
|
|
17
19
|
let s = seed | 0;
|
|
18
20
|
return () => {
|
|
19
21
|
s = s + 0x6D2B79F5 | 0;
|
|
@@ -21,37 +23,31 @@ export const setupMouseMovementHumanization = async (client) => {
|
|
|
21
23
|
t = t + Math.imul(t ^ t >>> 7, 61 | t) ^ t;
|
|
22
24
|
return ((t ^ t >>> 14) >>> 0) / 4294967296;
|
|
23
25
|
};
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
// re-executes on every reload via addScriptToEvaluateOnNewDocument.
|
|
27
|
-
const _stableHash = (salt) => {
|
|
28
|
-
const _s = typeof __stealth !== 'undefined' ? __stealth : {};
|
|
26
|
+
});
|
|
27
|
+
const sessionSeed = (_s.stableHash ? _s.stableHash(0xCAFE1009) : (() => {
|
|
29
28
|
const key = _s.seedKey || '';
|
|
30
29
|
const ua = navigator.userAgent || '';
|
|
31
|
-
const
|
|
32
|
-
let h =
|
|
30
|
+
const sc = screen;
|
|
31
|
+
let h = 0xCAFE1009;
|
|
33
32
|
for (let i = 0; i < key.length; i++) h = (h << 5) - h + key.charCodeAt(i) | 0;
|
|
34
33
|
for (let i = 0; i < ua.length; i++) h = (h << 5) - h + ua.charCodeAt(i) | 0;
|
|
35
|
-
h = (h << 5) - h + (
|
|
36
|
-
h = (h << 5) - h + (
|
|
37
|
-
h = (h << 5) - h + (
|
|
34
|
+
h = (h << 5) - h + (sc.width || 0) | 0;
|
|
35
|
+
h = (h << 5) - h + (sc.height || 0) | 0;
|
|
36
|
+
h = (h << 5) - h + (sc.colorDepth || 0) | 0;
|
|
38
37
|
return h >>> 0;
|
|
39
|
-
};
|
|
40
|
-
const
|
|
41
|
-
const seededRandom = createSeededRNG(sessionSeed);
|
|
38
|
+
})());
|
|
39
|
+
const seededRandom = _createRNG(sessionSeed);
|
|
42
40
|
|
|
43
41
|
// Bezier curve movement generator
|
|
44
42
|
_s.humanizeMouse = (fromX, fromY, toX, toY) => {
|
|
45
43
|
const steps = 20 + Math.floor(seededRandom() * 10);
|
|
46
44
|
const points = [];
|
|
47
45
|
|
|
48
|
-
// Generate control points for bezier curve
|
|
49
46
|
const cp1x = fromX + (toX - fromX) * 0.25 + (seededRandom() - 0.5) * 50;
|
|
50
47
|
const cp1y = fromY + (toY - fromY) * 0.25 + (seededRandom() - 0.5) * 50;
|
|
51
48
|
const cp2x = fromX + (toX - fromX) * 0.75 + (seededRandom() - 0.5) * 50;
|
|
52
49
|
const cp2y = fromY + (toY - fromY) * 0.75 + (seededRandom() - 0.5) * 50;
|
|
53
50
|
|
|
54
|
-
// Calculate bezier curve points
|
|
55
51
|
for (let i = 0; i <= steps; i++) {
|
|
56
52
|
const t = i / steps;
|
|
57
53
|
const t2 = t * t;
|
|
@@ -68,6 +64,15 @@ export const setupMouseMovementHumanization = async (client) => {
|
|
|
68
64
|
|
|
69
65
|
return points;
|
|
70
66
|
};
|
|
71
|
-
})()
|
|
67
|
+
})();
|
|
68
|
+
`;
|
|
69
|
+
/**
|
|
70
|
+
* @deprecated The browser-context script is now bundled via
|
|
71
|
+
* createMouseMovementHumanizationScript(). This function is kept only as a
|
|
72
|
+
* no-op so callers that haven't been updated don't break at runtime.
|
|
73
|
+
*/
|
|
74
|
+
export const setupMouseMovementHumanization = async (_client) => {
|
|
75
|
+
// No-op: script is now included in the main bundled injection to avoid
|
|
76
|
+
// multiple addScriptToEvaluateOnNewDocument calls (detection vector).
|
|
72
77
|
};
|
|
73
78
|
//# sourceMappingURL=mouse-humanization.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mouse-humanization.js","sourceRoot":"","sources":["../../../src/fingerprinting/fingerprint-overrides/mouse-humanization.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"mouse-humanization.js","sourceRoot":"","sources":["../../../src/fingerprinting/fingerprint-overrides/mouse-humanization.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,qCAAqC,GAAG,GAAW,EAAE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyDlE,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,KAAK,EAAE,OAAY,EAAiB,EAAE;IAChF,uEAAuE;IACvE,sEAAsE;AAC1E,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform-consistency.d.ts","sourceRoot":"","sources":["../../../src/fingerprinting/fingerprint-overrides/platform-consistency.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,WAAW,cAAc;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,+BAA+B,aAAc,MAAM,oBAAoB,cAAc,KAAG,
|
|
1
|
+
{"version":3,"file":"platform-consistency.d.ts","sourceRoot":"","sources":["../../../src/fingerprinting/fingerprint-overrides/platform-consistency.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,WAAW,cAAc;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,+BAA+B,aAAc,MAAM,oBAAoB,cAAc,KAAG,MA2pBpG,CAAC"}
|
|
@@ -111,7 +111,14 @@ export const createPlatformConsistencyScript = (platform, fingerprintData) => {
|
|
|
111
111
|
return `
|
|
112
112
|
(() => {
|
|
113
113
|
'use strict';
|
|
114
|
-
|
|
114
|
+
|
|
115
|
+
// Only run in the top-level frame. Sub-frames (iframes) should keep native
|
|
116
|
+
// property descriptors so that detection tools comparing main-frame getter
|
|
117
|
+
// identity vs iframe getter identity (hasMismatchPlatformIframe) find no
|
|
118
|
+
// discrepancy. The main-frame injection already cannot override non-
|
|
119
|
+
// configurable navigator properties, so leaving iframes at native is correct.
|
|
120
|
+
if (window !== window.top) return;
|
|
121
|
+
|
|
115
122
|
// Platform Consistency for ${platform}
|
|
116
123
|
const config = ${JSON.stringify(config)};
|
|
117
124
|
|
|
@@ -133,15 +140,21 @@ export const createPlatformConsistencyScript = (platform, fingerprintData) => {
|
|
|
133
140
|
}
|
|
134
141
|
};
|
|
135
142
|
|
|
136
|
-
// Override navigator properties for platform consistency (with guards)
|
|
143
|
+
// Override navigator properties for platform consistency (with guards).
|
|
144
|
+
// NOTE: vendorSub / cookieEnabled / onLine are intentionally omitted —
|
|
145
|
+
// their native Chrome values always match the fingerprint values, and adding
|
|
146
|
+
// instance-level JS getters for them without doing the same in sub-frames
|
|
147
|
+
// creates a descriptor asymmetry that detection tools flag as
|
|
148
|
+
// hasMismatchPlatformIframe. Injecting into sub-frames is guarded off
|
|
149
|
+
// above (window !== window.top), so we only define properties where Chrome
|
|
150
|
+
// already exposes a non-configurable native getter at the instance level
|
|
151
|
+
// (platform, vendor, userAgent, etc.) — those fail silently in both
|
|
152
|
+
// contexts and stay symmetric.
|
|
137
153
|
safeDefineProperty(navigator, 'platform', () => config.platform);
|
|
138
154
|
safeDefineProperty(navigator, 'vendor', () => config.vendor);
|
|
139
|
-
safeDefineProperty(navigator, 'vendorSub', () => config.vendorSub);
|
|
140
155
|
safeDefineProperty(navigator, 'productSub', () => config.productSub);
|
|
141
156
|
safeDefineProperty(navigator, 'hardwareConcurrency', () => config.hardwareConcurrency);
|
|
142
157
|
safeDefineProperty(navigator, 'maxTouchPoints', () => config.maxTouchPoints);
|
|
143
|
-
safeDefineProperty(navigator, 'cookieEnabled', () => config.cookieEnabled);
|
|
144
|
-
safeDefineProperty(navigator, 'onLine', () => config.onLine);
|
|
145
158
|
safeDefineProperty(navigator, 'language', () => config.language);
|
|
146
159
|
safeDefineProperty(navigator, 'languages', () => config.languages);
|
|
147
160
|
|
|
@@ -240,28 +253,12 @@ export const createPlatformConsistencyScript = (platform, fingerprintData) => {
|
|
|
240
253
|
safeDefineProperty(screen, 'colorDepth', () => config.colorDepth);
|
|
241
254
|
safeDefineProperty(screen, 'pixelDepth', () => config.screenDepth || config.colorDepth);
|
|
242
255
|
|
|
243
|
-
//
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
return param === 0x9245
|
|
250
|
-
? 'NVIDIA Corporation'
|
|
251
|
-
: 'ANGLE (NVIDIA, NVIDIA GeForce GTX 1660 Ti Direct3D 11.0)'; // Fixed: fewer tokens
|
|
252
|
-
} else if (config.platform === 'MacIntel') {
|
|
253
|
-
return param === 0x9245 ? 'Apple Inc.' : 'ANGLE (Apple, Apple M1 Pro, OpenGL 4.1)';
|
|
254
|
-
} else {
|
|
255
|
-
return param === 0x9245 ? 'Intel' : 'ANGLE (Intel, Mesa Intel(R) UHD Graphics 630, OpenGL 4.6)';
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
return getParameterProto.apply(this, arguments);
|
|
259
|
-
};
|
|
260
|
-
|
|
261
|
-
if (typeof WebGL2RenderingContext !== 'undefined') {
|
|
262
|
-
WebGL2RenderingContext.prototype.getParameter = WebGLRenderingContext.prototype.getParameter;
|
|
263
|
-
}
|
|
264
|
-
|
|
256
|
+
// NOTE: WebGL getParameter override intentionally removed.
|
|
257
|
+
// webgl-spoofing.ts is the single authority for WebGL vendor/renderer.
|
|
258
|
+
// Having multiple modules override the same prototype method means only
|
|
259
|
+
// the last one survives — a silent conflict that produces inconsistent
|
|
260
|
+
// GPU strings across vendor/renderer values.
|
|
261
|
+
|
|
265
262
|
// ========== 2024-2025 Enhanced Platform Consistency ==========
|
|
266
263
|
|
|
267
264
|
// Screen Orientation API Consistency
|
|
@@ -584,10 +581,71 @@ export const createPlatformConsistencyScript = (platform, fingerprintData) => {
|
|
|
584
581
|
}
|
|
585
582
|
};
|
|
586
583
|
|
|
584
|
+
// ── Iframe prototype alignment ───────────────────────────────────────────
|
|
585
|
+
// Detection technique used by fpscanner.com (hasMismatchPlatformIframe):
|
|
586
|
+
// const nativeGet = Object.getOwnPropertyDescriptor(
|
|
587
|
+
// iframe.contentWindow.Navigator.prototype, prop)?.get;
|
|
588
|
+
// const realValue = nativeGet.call(navigator); // bypasses instance override
|
|
589
|
+
// When the main frame has property overrides (JS or CDP-injected native), calling
|
|
590
|
+
// the iframe's prototype getter on main navigator returns the underlying C++ value,
|
|
591
|
+
// which differs from the overridden value → mismatch detected.
|
|
592
|
+
// Fix: intercept contentWindow access and override the iframe's Navigator.prototype
|
|
593
|
+
// getters to return the same value the main frame's navigator currently reports.
|
|
594
|
+
try {
|
|
595
|
+
const _fpAlignIframeProto = (win) => {
|
|
596
|
+
try {
|
|
597
|
+
if (!win || !win.navigator) return;
|
|
598
|
+
const iwProto = Object.getPrototypeOf(win.navigator);
|
|
599
|
+
const propsToAlign = [
|
|
600
|
+
'platform', 'hardwareConcurrency', 'userAgent', 'vendor',
|
|
601
|
+
'productSub', 'appVersion', 'appCodeName', 'appName', 'product',
|
|
602
|
+
];
|
|
603
|
+
for (const prop of propsToAlign) {
|
|
604
|
+
try {
|
|
605
|
+
const mainVal = (navigator)[prop];
|
|
606
|
+
const protoDesc = Object.getOwnPropertyDescriptor(iwProto, prop);
|
|
607
|
+
if (!protoDesc || protoDesc.configurable !== false) {
|
|
608
|
+
// Save the native getter's toString string BEFORE replacing it.
|
|
609
|
+
// fpscanner (hasMismatchPlatformIframe) checks whether the
|
|
610
|
+
// iframe's prototype getter toString looks like native code.
|
|
611
|
+
// Our replacement getter's .toString() must return the same
|
|
612
|
+
// native-code string the original getter had.
|
|
613
|
+
const nativeGetStr = protoDesc?.get?.toString()
|
|
614
|
+
?? \`function get \${prop}() { [native code] }\`;
|
|
615
|
+
const ourGetter = (() => { const v = mainVal; return function() { return v; }; })();
|
|
616
|
+
Object.defineProperty(ourGetter, 'toString', {
|
|
617
|
+
value: () => nativeGetStr,
|
|
618
|
+
configurable: true,
|
|
619
|
+
writable: true,
|
|
620
|
+
});
|
|
621
|
+
Object.defineProperty(iwProto, prop, {
|
|
622
|
+
get: ourGetter,
|
|
623
|
+
configurable: true,
|
|
624
|
+
});
|
|
625
|
+
}
|
|
626
|
+
} catch (_) { /* skip non-configurable property */ }
|
|
627
|
+
}
|
|
628
|
+
} catch (_) { /* cross-origin iframe — skip */ }
|
|
629
|
+
};
|
|
630
|
+
|
|
631
|
+
const _fpCWDesc = Object.getOwnPropertyDescriptor(HTMLIFrameElement.prototype, 'contentWindow');
|
|
632
|
+
if (_fpCWDesc && _fpCWDesc.get) {
|
|
633
|
+
const _fpCWGet = _fpCWDesc.get;
|
|
634
|
+
Object.defineProperty(HTMLIFrameElement.prototype, 'contentWindow', {
|
|
635
|
+
get() {
|
|
636
|
+
const win = _fpCWGet.call(this);
|
|
637
|
+
if (win) _fpAlignIframeProto(win);
|
|
638
|
+
return win;
|
|
639
|
+
},
|
|
640
|
+
configurable: true,
|
|
641
|
+
});
|
|
642
|
+
}
|
|
643
|
+
} catch (_) { /* HTMLIFrameElement not available */ }
|
|
644
|
+
|
|
587
645
|
// Initialize all enhanced spoofing
|
|
588
646
|
const DEBUG_PREFIX = '[CDP-FP-DEBUG]';
|
|
589
647
|
const ERROR_PREFIX = '[CDP-FP-ERROR]';
|
|
590
|
-
|
|
648
|
+
|
|
591
649
|
console.log(DEBUG_PREFIX, 'Starting platform consistency overrides for:', config.platform);
|
|
592
650
|
|
|
593
651
|
const applyConsistency = (name, fn) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform-consistency.js","sourceRoot":"","sources":["../../../src/fingerprinting/fingerprint-overrides/platform-consistency.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAuBH,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,QAAgB,EAAE,eAAgC,EAAU,EAAE;IAC1G,uDAAuD;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AAS,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC;YAC1B,OAAO,EAAE;gBACL,EAAE,IAAI,EAAE,YAAY,EAAE,QAAQ,EAAE,qBAAqB,EAAE;gBACvD,EAAE,IAAI,EAAE,mBAAmB,EAAE,QAAQ,EAAE,qBAAqB,EAAE;gBAC9D,EAAE,IAAI,EAAE,qBAAqB,EAAE,QAAQ,EAAE,qBAAqB,EAAE;aACnE;SACJ;KACJ,CAAC;IAEF,MAAM,aAAa,GAAG,eAAe,CAAC,QAAwC,CAAC,IAAI,eAAe,CAAC,cAAc,CAAC,CAAC;IAEnH,mDAAmD;IACnD,MAAM,MAAM,GAAG,eAAe,CAAC,CAAC,CAAC;QAC7B,GAAG,aAAa;QAChB,GAAG,eAAe;QAClB,8BAA8B;QAC9B,QAAQ,EAAE,eAAe,CAAC,QAAQ,IAAI,QAAQ;KACjD,CAAC,CAAC,CAAC,aAAa,CAAC;IAElB,OAAO
|
|
1
|
+
{"version":3,"file":"platform-consistency.js","sourceRoot":"","sources":["../../../src/fingerprinting/fingerprint-overrides/platform-consistency.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAuBH,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,QAAgB,EAAE,eAAgC,EAAU,EAAE;IAC1G,uDAAuD;IACvD,MAAM,eAAe,GAAG;QACpB,OAAO,EAAE;YACL,gBAAgB,EAAE,GAAG;YACrB,WAAW,EAAE,EAAE;YACf,UAAU,EAAE,EAAE;YACd,mBAAmB,EAAE,CAAC;YACtB,cAAc,EAAE,CAAC;YACjB,QAAQ,EAAE,OAAO;YACjB,KAAK,EAAE,6BAA6B;YACpC,MAAM,EAAE,aAAa;YACrB,SAAS,EAAE,EAAE;YACb,UAAU,EAAE,UAAU;YACtB,aAAa,EAAE,IAAI;YACnB,MAAM,EAAE,IAAI;YACZ,QAAQ,EAAE,OAAO;YACjB,SAAS,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC;YAC1B,SAAS,EAA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C,CAAC;QAC7B,GAAG,aAAa;QAChB,GAAG,eAAe;QAClB,8BAA8B;QAC9B,QAAQ,EAAE,eAAe,CAAC,QAAQ,IAAI,QAAQ;KACjD,CAAC,CAAC,CAAC,aAAa,CAAC;IAElB,OAAO;;;;;;;;;;;kCAWuB,QAAQ;qBACrB,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAyiBrC,CAAC;AACP,CAAC,CAAC"}
|
|
@@ -48,8 +48,15 @@ export declare const humanScroll: (client: unknown, targetY: number, config?: Pa
|
|
|
48
48
|
*/
|
|
49
49
|
export declare const humanScrollToElement: (client: unknown, selector: string, config?: Partial<ScrollConfig>) => Promise<void>;
|
|
50
50
|
/**
|
|
51
|
-
* Setup scroll humanization at CDP level
|
|
51
|
+
* Setup scroll humanization at CDP level.
|
|
52
|
+
*
|
|
53
|
+
* Pass `useNativeStealth: true` when running on the patched anti-detect Cromite
|
|
54
|
+
* build — the JS `WheelEvent` constructor override and pass-through `scrollTo`
|
|
55
|
+
* shims add no value on top of the native browser behaviour and only introduce
|
|
56
|
+
* detectable prototype tampering. In that mode this function no-ops.
|
|
52
57
|
*/
|
|
53
|
-
export declare const setupScrollHumanization: (client: unknown
|
|
58
|
+
export declare const setupScrollHumanization: (client: unknown, options?: {
|
|
59
|
+
useNativeStealth?: boolean;
|
|
60
|
+
}) => Promise<void>;
|
|
54
61
|
export {};
|
|
55
62
|
//# sourceMappingURL=scroll-humanization.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scroll-humanization.d.ts","sourceRoot":"","sources":["../../../src/fingerprinting/fingerprint-overrides/scroll-humanization.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH;;GAEG;AACH,UAAU,YAAY;IAClB,mDAAmD;IACnD,gBAAgB,EAAE,MAAM,CAAC;IACzB,gCAAgC;IAChC,cAAc,EAAE,MAAM,CAAC;IACvB,iDAAiD;IACjD,YAAY,EAAE,MAAM,CAAC;IACrB,uCAAuC;IACvC,WAAW,EAAE,MAAM,CAAC;IACpB,sCAAsC;IACtC,uBAAuB,EAAE,MAAM,CAAC;IAChC,oDAAoD;IACpD,oBAAoB,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC,wCAAwC;IACxC,UAAU,EAAE,MAAM,CAAC;CACtB;AAYD;;GAEG;AACH,eAAO,MAAM,kBAAkB,WACnB,MAAM,WACL,MAAM,WACP,OAAO,CAAC,YAAY,CAAC,KAC9B;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAyD9B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,8BAA8B,QAAO,MA+FjD,CAAC;AAOF;;GAEG;AACH,eAAO,MAAM,WAAW,WACZ,OAAO,WACN,MAAM,WACP,OAAO,CAAC,YAAY,CAAC,KAC9B,OAAO,CAAC,IAAI,CAuDd,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB,WACrB,OAAO,YACL,MAAM,WACR,OAAO,CAAC,YAAY,CAAC,KAC9B,OAAO,CAAC,IAAI,CAsCd,CAAC;AAEF
|
|
1
|
+
{"version":3,"file":"scroll-humanization.d.ts","sourceRoot":"","sources":["../../../src/fingerprinting/fingerprint-overrides/scroll-humanization.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH;;GAEG;AACH,UAAU,YAAY;IAClB,mDAAmD;IACnD,gBAAgB,EAAE,MAAM,CAAC;IACzB,gCAAgC;IAChC,cAAc,EAAE,MAAM,CAAC;IACvB,iDAAiD;IACjD,YAAY,EAAE,MAAM,CAAC;IACrB,uCAAuC;IACvC,WAAW,EAAE,MAAM,CAAC;IACpB,sCAAsC;IACtC,uBAAuB,EAAE,MAAM,CAAC;IAChC,oDAAoD;IACpD,oBAAoB,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC,wCAAwC;IACxC,UAAU,EAAE,MAAM,CAAC;CACtB;AAYD;;GAEG;AACH,eAAO,MAAM,kBAAkB,WACnB,MAAM,WACL,MAAM,WACP,OAAO,CAAC,YAAY,CAAC,KAC9B;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAyD9B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,8BAA8B,QAAO,MA+FjD,CAAC;AAOF;;GAEG;AACH,eAAO,MAAM,WAAW,WACZ,OAAO,WACN,MAAM,WACP,OAAO,CAAC,YAAY,CAAC,KAC9B,OAAO,CAAC,IAAI,CAuDd,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB,WACrB,OAAO,YACL,MAAM,WACR,OAAO,CAAC,YAAY,CAAC,KAC9B,OAAO,CAAC,IAAI,CAsCd,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,WACxB,OAAO,YACL;IAAE,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAAE,KACzC,OAAO,CAAC,IAAI,CAed,CAAC"}
|
|
@@ -231,9 +231,17 @@ export const humanScrollToElement = async (client, selector, config = {}) => {
|
|
|
231
231
|
await humanScroll(client, Math.max(0, targetY), config);
|
|
232
232
|
};
|
|
233
233
|
/**
|
|
234
|
-
* Setup scroll humanization at CDP level
|
|
234
|
+
* Setup scroll humanization at CDP level.
|
|
235
|
+
*
|
|
236
|
+
* Pass `useNativeStealth: true` when running on the patched anti-detect Cromite
|
|
237
|
+
* build — the JS `WheelEvent` constructor override and pass-through `scrollTo`
|
|
238
|
+
* shims add no value on top of the native browser behaviour and only introduce
|
|
239
|
+
* detectable prototype tampering. In that mode this function no-ops.
|
|
235
240
|
*/
|
|
236
|
-
export const setupScrollHumanization = async (client) => {
|
|
241
|
+
export const setupScrollHumanization = async (client, options) => {
|
|
242
|
+
if (options?.useNativeStealth) {
|
|
243
|
+
return;
|
|
244
|
+
}
|
|
237
245
|
const runtimeClient = client;
|
|
238
246
|
// NOTE: Using addScriptToEvaluateOnNewDocument instead of Runtime.evaluate
|
|
239
247
|
// Runtime.evaluate is a CDP detection vector
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scroll-humanization.js","sourceRoot":"","sources":["../../../src/fingerprinting/fingerprint-overrides/scroll-humanization.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAsBH,MAAM,qBAAqB,GAAiB;IACxC,gBAAgB,EAAE,GAAG;IACrB,cAAc,EAAE,EAAE;IAClB,YAAY,EAAE,IAAI;IAClB,WAAW,EAAE,CAAC;IACd,uBAAuB,EAAE,IAAI;IAC7B,oBAAoB,EAAE,CAAC,GAAG,EAAE,IAAI,CAAC;IACjC,UAAU,EAAE,EAAE,EAAE,SAAS;CAC5B,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAC9B,MAAc,EACd,OAAe,EACf,SAAgC,EAAE,EACJ,EAAE;IAChC,MAAM,GAAG,GAAG,EA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AAI,CAAC,gBAAgB,EAAE,CAAC;IACxD,MAAM,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC,YAAY,CAAC;IAE3D,kEAAkE;IAClE,MAAM,OAAO,GAAG,UAAU,GAAG,CAAC,cAAc,GAAG,CAAC,CAAC,GAAG,CAAC,aAAa,GAAG,CAAC,CAAC,CAAC;IAExE,MAAM,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,CAAC;AAC5D,CAAC,CAAC;AAEF
|
|
1
|
+
{"version":3,"file":"scroll-humanization.js","sourceRoot":"","sources":["../../../src/fingerprinting/fingerprint-overrides/scroll-humanization.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAsBH,MAAM,qBAAqB,GAAiB;IACxC,gBAAgB,EAAE,GAAG;IACrB,cAAc,EAAE,EAAE;IAClB,YAAY,EAAE,IAAI;IAClB,WAAW,EAAE,CAAC;IACd,uBAAuB,EAAE,IAAI;IAC7B,oBAAoB,EAAE,CAAC,GAAG,EAAE,IAAI,CAAC;IACjC,UAAU,EAAE,EAAE,EAAE,SAAS;CAC5B,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAC9B,MAAc,EACd,OAAe,EACf,SAAgC,EAAE,EACJ,EAAE;IAChC,MAAM,GAAG,GAAG,EAAE,GAAG,qBAAqB,EAAE,GAAG,MAAM,EAAE,CAAC;IACpD,MAAM,IAAI,GAAmC,EAAE,CAAC;IAEhD,MAAM,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5C,MAAM,aAAa,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,GAAG,MAAM,CAAC,CAAC;IAEjD,qCAAqC;IACrC,IAAI,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,gBAAgB,GAAG,CAAC,EAA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AM,CAAC,MAAM,uBAAuB,GAAG,KAAK,EACxC,MAAe,EACf,OAAwC,EAC3B,EAAE;IACf,IAAI,OAAO,EAAE,gBAAgB,EAAE,CAAC;QAC5B,OAAO;IACX,CAAC;IACD,MAAM,aAAa,GAAG,MAIrB,CAAC;IAEF,2EAA2E;IAC3E,6CAA6C;IAC7C,MAAM,aAAa,CAAC,IAAI,CAAC,gCAAgC,CAAC;QACtD,MAAM,EAAE,8BAA8B,EAAE;KAC3C,CAAC,CAAC;AACP,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stealth-script.d.ts","sourceRoot":"","sources":["../../../src/fingerprinting/fingerprint-overrides/stealth-script.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,eAAO,MAAM,mBAAmB,QAAO,
|
|
1
|
+
{"version":3,"file":"stealth-script.d.ts","sourceRoot":"","sources":["../../../src/fingerprinting/fingerprint-overrides/stealth-script.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,eAAO,MAAM,mBAAmB,QAAO,MA6kCtC,CAAC"}
|
|
@@ -33,15 +33,18 @@ export const createStealthScript = () => {
|
|
|
33
33
|
});
|
|
34
34
|
};
|
|
35
35
|
|
|
36
|
-
//
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
36
|
+
// Use centralized stable hash from __stealth store (set up by utils.ts preamble).
|
|
37
|
+
// Falls back to a UA+screen hash so the module works even if utils.ts somehow
|
|
38
|
+
// runs after this script (should not happen given injection order).
|
|
39
|
+
const _ss = typeof __stealth !== 'undefined' ? __stealth : {};
|
|
40
|
+
const sessionSeed = (_ss.stableHash
|
|
41
|
+
? _ss.stableHash(0xCAFE9001)
|
|
42
|
+
: (() => {
|
|
43
|
+
const ua = navigator.userAgent || '';
|
|
44
|
+
const s = window.screen;
|
|
45
|
+
return ua.length + (s.width || 0) + (s.height || 0);
|
|
46
|
+
})()
|
|
47
|
+
);
|
|
45
48
|
|
|
46
49
|
// Helper to safely define property with guards
|
|
47
50
|
const safeDefineProperty = (obj, prop, descriptor) => {
|
|
@@ -84,11 +87,13 @@ export const createStealthScript = () => {
|
|
|
84
87
|
|
|
85
88
|
// 3. WebDriver and Automation Flags Removal (2025)
|
|
86
89
|
const removeAutomationFlags = () => {
|
|
87
|
-
//
|
|
88
|
-
//
|
|
89
|
-
//
|
|
90
|
-
//
|
|
91
|
-
|
|
90
|
+
// NOTE: navigator.webdriver is NOT overridden here.
|
|
91
|
+
// The Chromium C++ patch (Anti-Detect 0006) makes navigator.webdriver
|
|
92
|
+
// unconditionally return false at the prototype level. Adding a JS own
|
|
93
|
+
// property here would make navigator.hasOwnProperty('webdriver') === true
|
|
94
|
+
// and Object.getOwnPropertyDescriptor(navigator,'webdriver') return a
|
|
95
|
+
// descriptor, both of which are detectable tells that don't exist in real
|
|
96
|
+
// Chrome. The C++ patch is the correct and sufficient fix.
|
|
92
97
|
|
|
93
98
|
// Remove automation indicators
|
|
94
99
|
const automationProperties = [
|
|
@@ -113,6 +118,10 @@ export const createStealthScript = () => {
|
|
|
113
118
|
} catch (e) {}
|
|
114
119
|
});
|
|
115
120
|
|
|
121
|
+
// Ensure Error.stackTraceLimit is the V8 default (10).
|
|
122
|
+
// Some automation frameworks change this value; FingerprintJS checks it.
|
|
123
|
+
try { if (typeof Error.stackTraceLimit !== 'undefined') Error.stackTraceLimit = 10; } catch (e) {}
|
|
124
|
+
|
|
116
125
|
// Ensure window.chrome exists (handled more fully by spoofChromeRuntime)
|
|
117
126
|
// NOTE: Removed stack-trace-based chrome getter that created new Error()
|
|
118
127
|
// on every access - expensive and broken since stack sanitization removes
|
|
@@ -205,6 +214,8 @@ export const createStealthScript = () => {
|
|
|
205
214
|
Object.defineProperty(arr, 'item', { value: (index) => arr[index] || null, writable: false, enumerable: false });
|
|
206
215
|
Object.defineProperty(arr, 'namedItem', { value: (name) => arr[name] || null, writable: false, enumerable: false });
|
|
207
216
|
Object.defineProperty(arr, 'refresh', { value: () => {}, writable: false, enumerable: false });
|
|
217
|
+
// Allow for...of iteration — checked by DataDome and FingerprintJS Pro
|
|
218
|
+
arr[Symbol.iterator] = function* () { for (let i = 0; i < fakePlugins.length; i++) yield arr[i]; };
|
|
208
219
|
return arr;
|
|
209
220
|
};
|
|
210
221
|
safeDefineGetter(navigator, 'plugins', pluginsGetter);
|
|
@@ -317,13 +328,11 @@ export const createStealthScript = () => {
|
|
|
317
328
|
getManifest: () => ({}),
|
|
318
329
|
// Real Chrome extension IDs are 32 lowercase alpha chars (a-p, base16 with a-p)
|
|
319
330
|
id: undefined,
|
|
320
|
-
connect: ()
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
postMessage: () => {}
|
|
326
|
-
}),
|
|
331
|
+
connect: function() {
|
|
332
|
+
// Real Chrome throws this exact error when no extension is receiving
|
|
333
|
+
// DataDome and PerimeterX specifically test this error message
|
|
334
|
+
throw new Error('Could not establish connection. Receiving end does not exist.');
|
|
335
|
+
},
|
|
327
336
|
sendMessage: () => {},
|
|
328
337
|
getURL: (path) => '',
|
|
329
338
|
onConnect: { addListener: () => {}, removeListener: () => {} },
|
|
@@ -376,11 +385,17 @@ export const createStealthScript = () => {
|
|
|
376
385
|
}
|
|
377
386
|
|
|
378
387
|
// chrome.csi() - Chrome-specific, returns page load timing info
|
|
388
|
+
// Values are pre-computed from session seed so they're stable across calls.
|
|
389
|
+
// Real Chrome returns consistent timing per page load; Math.random() is detectable.
|
|
379
390
|
if (window.chrome && !window.chrome.csi) {
|
|
391
|
+
const _csiRng = (_ss.createRNG ? _ss.createRNG(sessionSeed ^ 0x1001) : (() => { let x = sessionSeed ^ 0x1001; return () => { x = (x * 1664525 + 1013904223) >>> 0; return x / 4294967296; }; })());
|
|
392
|
+
const _csiLoadOffset = 500 + _csiRng() * 2000;
|
|
393
|
+
const _csiStartOffset = 1000 + _csiRng() * 3000;
|
|
380
394
|
window.chrome.csi = function() {
|
|
395
|
+
const now = Date.now();
|
|
381
396
|
return {
|
|
382
|
-
onloadT:
|
|
383
|
-
startE:
|
|
397
|
+
onloadT: now - _csiLoadOffset,
|
|
398
|
+
startE: now - _csiStartOffset,
|
|
384
399
|
pageT: performance.now(),
|
|
385
400
|
tran: 15, // Normal navigation
|
|
386
401
|
};
|
|
@@ -388,20 +403,30 @@ export const createStealthScript = () => {
|
|
|
388
403
|
}
|
|
389
404
|
|
|
390
405
|
// chrome.loadTimes() - Chrome-specific, returns load timing info
|
|
406
|
+
// Pre-computed offsets from session seed for stability across calls.
|
|
391
407
|
if (window.chrome && !window.chrome.loadTimes) {
|
|
408
|
+
const _ltRng = (_ss.createRNG ? _ss.createRNG(sessionSeed ^ 0x1002) : (() => { let x = sessionSeed ^ 0x1002; return () => { x = (x * 1664525 + 1013904223) >>> 0; return x / 4294967296; }; })());
|
|
409
|
+
const _ltOffsets = {
|
|
410
|
+
commit: _ltRng() * 2,
|
|
411
|
+
finishDoc: _ltRng() * 1,
|
|
412
|
+
finishLoad: _ltRng() * 0.5,
|
|
413
|
+
firstPaint: _ltRng() * 1.5,
|
|
414
|
+
request: _ltRng() * 3,
|
|
415
|
+
startLoad: _ltRng() * 2.5,
|
|
416
|
+
};
|
|
392
417
|
window.chrome.loadTimes = function() {
|
|
393
418
|
const now = Date.now() / 1000;
|
|
394
419
|
return {
|
|
395
|
-
commitLoadTime: now -
|
|
420
|
+
commitLoadTime: now - _ltOffsets.commit,
|
|
396
421
|
connectionInfo: 'h2',
|
|
397
|
-
finishDocumentLoadTime: now -
|
|
398
|
-
finishLoadTime: now -
|
|
422
|
+
finishDocumentLoadTime: now - _ltOffsets.finishDoc,
|
|
423
|
+
finishLoadTime: now - _ltOffsets.finishLoad,
|
|
399
424
|
firstPaintAfterLoadTime: 0,
|
|
400
|
-
firstPaintTime: now -
|
|
425
|
+
firstPaintTime: now - _ltOffsets.firstPaint,
|
|
401
426
|
navigationType: 'Other',
|
|
402
427
|
npnNegotiatedProtocol: 'h2',
|
|
403
|
-
requestTime: now -
|
|
404
|
-
startLoadTime: now -
|
|
428
|
+
requestTime: now - _ltOffsets.request,
|
|
429
|
+
startLoadTime: now - _ltOffsets.startLoad,
|
|
405
430
|
wasAlternateProtocolAvailable: false,
|
|
406
431
|
wasFetchedViaSpdy: true,
|
|
407
432
|
wasNpnNegotiated: true,
|
|
@@ -622,8 +647,10 @@ export const createStealthScript = () => {
|
|
|
622
647
|
const originalGetGamepads = navigator.getGamepads;
|
|
623
648
|
if (originalGetGamepads) {
|
|
624
649
|
navigator.getGamepads = function() {
|
|
625
|
-
//
|
|
626
|
-
|
|
650
|
+
// Real Chrome returns GamepadList with 4 null slots when no gamepads
|
|
651
|
+
// connected — NOT an empty array. [] vs [null,null,null,null] is a
|
|
652
|
+
// checked difference between headed Chrome and headless/Chromium.
|
|
653
|
+
return [null, null, null, null];
|
|
627
654
|
};
|
|
628
655
|
}
|
|
629
656
|
};
|
|
@@ -922,10 +949,112 @@ export const createStealthScript = () => {
|
|
|
922
949
|
if (_s5.utils) _s5.utils.registerNativeFunction(window.postMessage, 'postMessage');
|
|
923
950
|
};
|
|
924
951
|
|
|
952
|
+
// 30. Document Visibility Spoofing
|
|
953
|
+
// hasFocus() and visibilityState were only patched inside datadome-bypass.ts,
|
|
954
|
+
// meaning Cloudflare / Akamai / PerimeterX saw raw headless values. Move them
|
|
955
|
+
// here so all crawls benefit.
|
|
956
|
+
const spoofDocumentVisibility = () => {
|
|
957
|
+
try {
|
|
958
|
+
Object.defineProperty(document, 'hidden', { get: () => false, configurable: true });
|
|
959
|
+
Object.defineProperty(document, 'visibilityState', { get: () => 'visible', configurable: true });
|
|
960
|
+
} catch (e) {}
|
|
961
|
+
|
|
962
|
+
document.hasFocus = function() { return true; };
|
|
963
|
+
try {
|
|
964
|
+
Object.defineProperty(document.hasFocus, 'toString', {
|
|
965
|
+
value: () => 'function hasFocus() { [native code] }',
|
|
966
|
+
configurable: true
|
|
967
|
+
});
|
|
968
|
+
} catch (e) {}
|
|
969
|
+
|
|
970
|
+
// Suppress CDP-lifecycle-driven visibilitychange events that expose headless state
|
|
971
|
+
const origAEL = document.addEventListener.bind(document);
|
|
972
|
+
const _hiddenEvtHandler = (e) => {
|
|
973
|
+
if (e.type === 'visibilitychange') { e.stopImmediatePropagation(); }
|
|
974
|
+
};
|
|
975
|
+
origAEL('visibilitychange', _hiddenEvtHandler, true);
|
|
976
|
+
};
|
|
977
|
+
|
|
978
|
+
// 31. Encrypted Media Extensions (Widevine) Spoofing
|
|
979
|
+
// Vanilla Chromium rejects requestMediaKeySystemAccess('com.widevine.alpha')
|
|
980
|
+
// with NotSupportedError. Real Chrome ships Widevine L3 and resolves.
|
|
981
|
+
// This is one of the most reliable Chrome-vs-Chromium signals (Cloudflare, FPjs, CreepJS).
|
|
982
|
+
const spoofEME = () => {
|
|
983
|
+
if (typeof navigator.requestMediaKeySystemAccess !== 'function') return;
|
|
984
|
+
|
|
985
|
+
const _origRMKSA = navigator.requestMediaKeySystemAccess.bind(navigator);
|
|
986
|
+
|
|
987
|
+
const _fakeRMKSA = function requestMediaKeySystemAccess(keySystem, configs) {
|
|
988
|
+
if (keySystem === 'com.widevine.alpha') {
|
|
989
|
+
const cfg = (Array.isArray(configs) && configs[0]) ? configs[0] : {};
|
|
990
|
+
const resolvedCfg = {
|
|
991
|
+
label: cfg.label || '',
|
|
992
|
+
initDataTypes: cfg.initDataTypes || ['cenc'],
|
|
993
|
+
audioCapabilities: cfg.audioCapabilities || [
|
|
994
|
+
{ contentType: 'audio/mp4;codecs="mp4a.40.2"', robustness: '' }
|
|
995
|
+
],
|
|
996
|
+
videoCapabilities: cfg.videoCapabilities || [
|
|
997
|
+
{ contentType: 'video/mp4;codecs="avc1.42E01E"', robustness: '' }
|
|
998
|
+
],
|
|
999
|
+
distinctiveIdentifier: 'not-allowed',
|
|
1000
|
+
persistentState: 'not-allowed',
|
|
1001
|
+
sessionTypes: ['temporary']
|
|
1002
|
+
};
|
|
1003
|
+
|
|
1004
|
+
const fakeMKS = {
|
|
1005
|
+
setServerCertificate: () => Promise.resolve(true),
|
|
1006
|
+
createSession: function(sessionType) {
|
|
1007
|
+
const sess = {
|
|
1008
|
+
sessionId: '',
|
|
1009
|
+
expiration: NaN,
|
|
1010
|
+
closed: new Promise(() => {}),
|
|
1011
|
+
keyStatuses: new Map(),
|
|
1012
|
+
onkeystatuseschange: null,
|
|
1013
|
+
onmessage: null,
|
|
1014
|
+
generateRequest: () => Promise.reject(new DOMException('InvalidStateError', 'InvalidStateError')),
|
|
1015
|
+
load: () => Promise.resolve(false),
|
|
1016
|
+
update: () => Promise.reject(new DOMException('InvalidStateError', 'InvalidStateError')),
|
|
1017
|
+
close: () => Promise.resolve(),
|
|
1018
|
+
remove: () => Promise.reject(new DOMException('InvalidStateError', 'InvalidStateError')),
|
|
1019
|
+
addEventListener: () => {},
|
|
1020
|
+
removeEventListener: () => {},
|
|
1021
|
+
dispatchEvent: () => true
|
|
1022
|
+
};
|
|
1023
|
+
return sess;
|
|
1024
|
+
}
|
|
1025
|
+
};
|
|
1026
|
+
|
|
1027
|
+
const fakeMKSA = {
|
|
1028
|
+
keySystem: 'com.widevine.alpha',
|
|
1029
|
+
getConfiguration: () => resolvedCfg,
|
|
1030
|
+
createMediaKeys: () => Promise.resolve(fakeMKS)
|
|
1031
|
+
};
|
|
1032
|
+
|
|
1033
|
+
return Promise.resolve(fakeMKSA);
|
|
1034
|
+
}
|
|
1035
|
+
// All other key systems fall through to native
|
|
1036
|
+
try { return _origRMKSA(keySystem, configs); }
|
|
1037
|
+
catch (e) { return Promise.reject(e); }
|
|
1038
|
+
};
|
|
1039
|
+
|
|
1040
|
+
// Override on both Navigator.prototype and the instance
|
|
1041
|
+
try {
|
|
1042
|
+
Object.defineProperty(Navigator.prototype, 'requestMediaKeySystemAccess', {
|
|
1043
|
+
value: _fakeRMKSA, writable: true, configurable: true
|
|
1044
|
+
});
|
|
1045
|
+
} catch (e) {
|
|
1046
|
+
try { navigator.requestMediaKeySystemAccess = _fakeRMKSA; } catch (e2) {}
|
|
1047
|
+
}
|
|
1048
|
+
|
|
1049
|
+
// Register for native-code toString masking
|
|
1050
|
+
const _s6 = typeof __stealth !== 'undefined' ? __stealth : {};
|
|
1051
|
+
if (_s6.utils) _s6.utils.registerNativeFunction(_fakeRMKSA, 'requestMediaKeySystemAccess');
|
|
1052
|
+
};
|
|
1053
|
+
|
|
925
1054
|
// Initialize all protections
|
|
926
1055
|
const DEBUG_PREFIX = '[CDP-FP-DEBUG]';
|
|
927
1056
|
const ERROR_PREFIX = '[CDP-FP-ERROR]';
|
|
928
|
-
|
|
1057
|
+
|
|
929
1058
|
console.log(DEBUG_PREFIX, 'Starting stealth protection injection...');
|
|
930
1059
|
|
|
931
1060
|
const applyProtection = (name, fn) => {
|
|
@@ -972,7 +1101,10 @@ export const createStealthScript = () => {
|
|
|
972
1101
|
applyProtection('Worker Constructor Protection', protectWorkerConstructor);
|
|
973
1102
|
applyProtection('SharedWorker Protection', protectSharedWorkerConstructor);
|
|
974
1103
|
applyProtection('PostMessage Protection', protectPostMessage);
|
|
975
|
-
|
|
1104
|
+
// Chrome authenticity patches — make Chromium look like real Chrome
|
|
1105
|
+
applyProtection('Document Visibility Spoofing', spoofDocumentVisibility);
|
|
1106
|
+
applyProtection('EME/Widevine Spoofing', spoofEME);
|
|
1107
|
+
|
|
976
1108
|
console.log(DEBUG_PREFIX, '✓ All stealth protections applied successfully');
|
|
977
1109
|
} catch (e) {
|
|
978
1110
|
console.error(ERROR_PREFIX, '✗ Failed to apply stealth protections:', e);
|