jumpy-lion 0.0.41 → 0.0.43
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/dist/browser-controller.d.ts.map +1 -1
- package/dist/browser-controller.js +102 -16
- package/dist/browser-controller.js.map +1 -1
- package/dist/browser-plugin.d.ts +20 -1
- package/dist/browser-plugin.d.ts.map +1 -1
- package/dist/browser-plugin.js +21 -1
- package/dist/browser-plugin.js.map +1 -1
- package/dist/browser-process/browser.d.ts +22 -1
- package/dist/browser-process/browser.d.ts.map +1 -1
- package/dist/browser-process/browser.js +77 -5
- package/dist/browser-process/browser.js.map +1 -1
- package/dist/browser-profiles/chrome/default.d.ts +116 -0
- package/dist/browser-profiles/chrome/default.d.ts.map +1 -1
- package/dist/browser-profiles/chrome/default.js +118 -1
- package/dist/browser-profiles/chrome/default.js.map +1 -1
- package/dist/browser-profiles/chrome/populate-profile.d.ts +76 -0
- package/dist/browser-profiles/chrome/populate-profile.d.ts.map +1 -0
- package/dist/browser-profiles/chrome/populate-profile.js +300 -0
- package/dist/browser-profiles/chrome/populate-profile.js.map +1 -0
- package/dist/browser-profiles/index.d.ts +1 -0
- package/dist/browser-profiles/index.d.ts.map +1 -1
- package/dist/browser-profiles/index.js +2 -0
- package/dist/browser-profiles/index.js.map +1 -1
- package/dist/crawler.d.ts +32 -1
- package/dist/crawler.d.ts.map +1 -1
- package/dist/crawler.js +7 -0
- package/dist/crawler.js.map +1 -1
- package/dist/fingerprinting/custom-fingerprint-injector.d.ts +87 -0
- package/dist/fingerprinting/custom-fingerprint-injector.d.ts.map +1 -0
- package/dist/fingerprinting/custom-fingerprint-injector.js +342 -0
- package/dist/fingerprinting/custom-fingerprint-injector.js.map +1 -0
- package/dist/fingerprinting/fingerprint-injector.d.ts +40 -2
- package/dist/fingerprinting/fingerprint-injector.d.ts.map +1 -1
- package/dist/fingerprinting/fingerprint-injector.js +452 -44
- 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 +11 -1
- package/dist/fingerprinting/fingerprint-overrides/audio-spoofing.js.map +1 -1
- package/dist/fingerprinting/fingerprint-overrides/canvas-protection.d.ts.map +1 -1
- package/dist/fingerprinting/fingerprint-overrides/canvas-protection.js +11 -1
- package/dist/fingerprinting/fingerprint-overrides/canvas-protection.js.map +1 -1
- package/dist/fingerprinting/fingerprint-overrides/cdp-detection-bypass.d.ts +14 -0
- package/dist/fingerprinting/fingerprint-overrides/cdp-detection-bypass.d.ts.map +1 -0
- package/dist/fingerprinting/fingerprint-overrides/cdp-detection-bypass.js +776 -0
- package/dist/fingerprinting/fingerprint-overrides/cdp-detection-bypass.js.map +1 -0
- package/dist/fingerprinting/fingerprint-overrides/client-rect-spoofing.d.ts.map +1 -1
- package/dist/fingerprinting/fingerprint-overrides/client-rect-spoofing.js +11 -1
- package/dist/fingerprinting/fingerprint-overrides/client-rect-spoofing.js.map +1 -1
- package/dist/fingerprinting/fingerprint-overrides/datadome-bypass.d.ts +14 -0
- package/dist/fingerprinting/fingerprint-overrides/datadome-bypass.d.ts.map +1 -0
- package/dist/fingerprinting/fingerprint-overrides/datadome-bypass.js +643 -0
- package/dist/fingerprinting/fingerprint-overrides/datadome-bypass.js.map +1 -0
- package/dist/fingerprinting/fingerprint-overrides/font-spoofing.d.ts.map +1 -1
- package/dist/fingerprinting/fingerprint-overrides/font-spoofing.js +11 -1
- package/dist/fingerprinting/fingerprint-overrides/font-spoofing.js.map +1 -1
- package/dist/fingerprinting/fingerprint-overrides/index.d.ts +17 -1
- package/dist/fingerprinting/fingerprint-overrides/index.d.ts.map +1 -1
- package/dist/fingerprinting/fingerprint-overrides/index.js +21 -1
- package/dist/fingerprinting/fingerprint-overrides/index.js.map +1 -1
- package/dist/fingerprinting/fingerprint-overrides/keyboard-humanization.d.ts +45 -0
- package/dist/fingerprinting/fingerprint-overrides/keyboard-humanization.d.ts.map +1 -0
- package/dist/fingerprinting/fingerprint-overrides/keyboard-humanization.js +291 -0
- package/dist/fingerprinting/fingerprint-overrides/keyboard-humanization.js.map +1 -0
- package/dist/fingerprinting/fingerprint-overrides/locale-spoofing.d.ts.map +1 -1
- package/dist/fingerprinting/fingerprint-overrides/locale-spoofing.js +153 -90
- package/dist/fingerprinting/fingerprint-overrides/locale-spoofing.js.map +1 -1
- package/dist/fingerprinting/fingerprint-overrides/mouse-humanization.d.ts.map +1 -1
- package/dist/fingerprinting/fingerprint-overrides/mouse-humanization.js +4 -5
- package/dist/fingerprinting/fingerprint-overrides/mouse-humanization.js.map +1 -1
- package/dist/fingerprinting/fingerprint-overrides/performance-spoofing.d.ts.map +1 -1
- package/dist/fingerprinting/fingerprint-overrides/performance-spoofing.js +11 -1
- package/dist/fingerprinting/fingerprint-overrides/performance-spoofing.js.map +1 -1
- package/dist/fingerprinting/fingerprint-overrides/platform-consistency.d.ts +13 -0
- package/dist/fingerprinting/fingerprint-overrides/platform-consistency.d.ts.map +1 -1
- package/dist/fingerprinting/fingerprint-overrides/platform-consistency.js +413 -70
- package/dist/fingerprinting/fingerprint-overrides/platform-consistency.js.map +1 -1
- package/dist/fingerprinting/fingerprint-overrides/prototype-integrity.d.ts +13 -0
- package/dist/fingerprinting/fingerprint-overrides/prototype-integrity.d.ts.map +1 -0
- package/dist/fingerprinting/fingerprint-overrides/prototype-integrity.js +355 -0
- package/dist/fingerprinting/fingerprint-overrides/prototype-integrity.js.map +1 -0
- package/dist/fingerprinting/fingerprint-overrides/runtime-enable-bypass.d.ts +12 -3
- package/dist/fingerprinting/fingerprint-overrides/runtime-enable-bypass.d.ts.map +1 -1
- package/dist/fingerprinting/fingerprint-overrides/runtime-enable-bypass.js +261 -71
- package/dist/fingerprinting/fingerprint-overrides/runtime-enable-bypass.js.map +1 -1
- package/dist/fingerprinting/fingerprint-overrides/scroll-humanization.d.ts +55 -0
- package/dist/fingerprinting/fingerprint-overrides/scroll-humanization.d.ts.map +1 -0
- package/dist/fingerprinting/fingerprint-overrides/scroll-humanization.js +380 -0
- package/dist/fingerprinting/fingerprint-overrides/scroll-humanization.js.map +1 -0
- package/dist/fingerprinting/fingerprint-overrides/stealth-script.d.ts +8 -0
- package/dist/fingerprinting/fingerprint-overrides/stealth-script.d.ts.map +1 -1
- package/dist/fingerprinting/fingerprint-overrides/stealth-script.js +756 -71
- package/dist/fingerprinting/fingerprint-overrides/stealth-script.js.map +1 -1
- package/dist/fingerprinting/fingerprint-overrides/storage-consistency.d.ts +13 -0
- package/dist/fingerprinting/fingerprint-overrides/storage-consistency.d.ts.map +1 -0
- package/dist/fingerprinting/fingerprint-overrides/storage-consistency.js +368 -0
- package/dist/fingerprinting/fingerprint-overrides/storage-consistency.js.map +1 -0
- package/dist/fingerprinting/fingerprint-overrides/timing-consistency.d.ts +13 -0
- package/dist/fingerprinting/fingerprint-overrides/timing-consistency.d.ts.map +1 -0
- package/dist/fingerprinting/fingerprint-overrides/timing-consistency.js +438 -0
- package/dist/fingerprinting/fingerprint-overrides/timing-consistency.js.map +1 -0
- package/dist/fingerprinting/fingerprint-overrides/ua-ch.d.ts +7 -1
- package/dist/fingerprinting/fingerprint-overrides/ua-ch.d.ts.map +1 -1
- package/dist/fingerprinting/fingerprint-overrides/ua-ch.js +158 -58
- package/dist/fingerprinting/fingerprint-overrides/ua-ch.js.map +1 -1
- package/dist/fingerprinting/fingerprint-overrides/utils.d.ts +12 -0
- package/dist/fingerprinting/fingerprint-overrides/utils.d.ts.map +1 -0
- package/dist/fingerprinting/fingerprint-overrides/utils.js +517 -0
- package/dist/fingerprinting/fingerprint-overrides/utils.js.map +1 -0
- package/dist/fingerprinting/fingerprint-overrides/webgl-spoofing.d.ts.map +1 -1
- package/dist/fingerprinting/fingerprint-overrides/webgl-spoofing.js +51 -10
- 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 +11 -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 +11 -1
- package/dist/fingerprinting/fingerprint-overrides/webrtc-spoofing.js.map +1 -1
- package/dist/page.d.ts +12 -0
- package/dist/page.d.ts.map +1 -1
- package/dist/page.js +35 -3
- package/dist/page.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/dist/fingerprinting/canvas-fingerprint.d.ts +0 -4
- package/dist/fingerprinting/canvas-fingerprint.d.ts.map +0 -1
- package/dist/fingerprinting/canvas-fingerprint.js +0 -60
- package/dist/fingerprinting/canvas-fingerprint.js.map +0 -1
|
@@ -1,84 +1,274 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Runtime.enable Bypass
|
|
3
|
-
* Prevents CDP detection through console.log(Error) technique
|
|
2
|
+
* Runtime.enable Bypass Script
|
|
3
|
+
* Prevents CDP detection through console.log(Error) technique and stack trace analysis.
|
|
4
|
+
*
|
|
5
|
+
* IMPORTANT: This is now a SCRIPT to be injected via addScriptToEvaluateOnNewDocument,
|
|
6
|
+
* NOT via Runtime.evaluate (which would defeat the purpose since Runtime.evaluate IS detectable!)
|
|
7
|
+
*
|
|
8
|
+
* Enhanced 2024-2025: Comprehensive stack trace sanitization that removes ALL CDP markers
|
|
4
9
|
*/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Creates the runtime enable bypass script that should be bundled with other stealth scripts.
|
|
12
|
+
* This script runs BEFORE page JavaScript and patches Error/console to hide CDP markers.
|
|
13
|
+
*/
|
|
14
|
+
export const createRuntimeEnableBypassScript = () => `
|
|
9
15
|
(() => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
'use strict';
|
|
17
|
+
const DEBUG_PREFIX = '[RUNTIME-ENABLE-BYPASS]';
|
|
18
|
+
|
|
19
|
+
try {
|
|
20
|
+
// =============================================================================
|
|
21
|
+
// PART 1: Comprehensive Error stack trace sanitization
|
|
22
|
+
// CDP detection often works by examining Error.stack for automation markers
|
|
23
|
+
// =============================================================================
|
|
24
|
+
|
|
25
|
+
const originalError = Error;
|
|
26
|
+
const originalErrorToString = Error.prototype.toString;
|
|
27
|
+
const originalErrorStackDesc = Object.getOwnPropertyDescriptor(Error.prototype, 'stack');
|
|
28
|
+
|
|
29
|
+
// Comprehensive patterns that reveal CDP/automation
|
|
30
|
+
const CDP_MARKER_PATTERNS = [
|
|
31
|
+
// Puppeteer/Playwright markers
|
|
32
|
+
/__puppeteer_evaluation_script__/g,
|
|
33
|
+
/__playwright_evaluation_script__/g,
|
|
34
|
+
/__driver_evaluate/g,
|
|
35
|
+
/__webdriver_evaluate/g,
|
|
36
|
+
/__selenium_evaluate/g,
|
|
37
|
+
/__fxdriver_evaluate/g,
|
|
38
|
+
|
|
39
|
+
// CDP protocol markers
|
|
40
|
+
/CDP_[A-Z_]+/g,
|
|
41
|
+
/Runtime\\.evaluate/g,
|
|
42
|
+
/Runtime\\.callFunctionOn/g,
|
|
43
|
+
/Page\\.addScriptToEvaluateOnNewDocument/g,
|
|
44
|
+
|
|
45
|
+
// DevTools markers
|
|
46
|
+
/devtools:\\/\\/[^\\s)]+/g,
|
|
47
|
+
/chrome-extension:\\/\\/[a-z]+\\/[^\\s)]+/g,
|
|
48
|
+
|
|
49
|
+
// Puppeteer-specific patterns
|
|
50
|
+
/pptr:[^\\s)]+/g,
|
|
51
|
+
/\\(pptr:[^)]+\\)/g,
|
|
52
|
+
|
|
53
|
+
// Anonymous script patterns that reveal CDP injection
|
|
54
|
+
/at <anonymous>:\\d+:\\d+/g,
|
|
55
|
+
/at Object\\.<anonymous> \\(<anonymous>:\\d+:\\d+\\)/g,
|
|
56
|
+
/at Object\\.construct \\(<anonymous>:\\d+:\\d+\\)/g,
|
|
57
|
+
/at Object\\.apply \\(<anonymous>:\\d+:\\d+\\)/g,
|
|
58
|
+
/at Object\\.get \\(<anonymous>:\\d+:\\d+\\)/g,
|
|
59
|
+
/at newHandler\\.<computed>/g,
|
|
60
|
+
/\\(<anonymous>:\\d+:\\d+\\)/g,
|
|
61
|
+
|
|
62
|
+
// Source URL comments
|
|
63
|
+
/\\/\\/# sourceURL=[^\\n]+/g,
|
|
64
|
+
/\\/\\/# sourceMappingURL=[^\\n]+/g,
|
|
65
|
+
/\\/\\/@sourceURL=[^\\n]+/g,
|
|
66
|
+
];
|
|
67
|
+
|
|
68
|
+
// Realistic replacement frames for different contexts
|
|
69
|
+
const REALISTIC_FRAMES = [
|
|
70
|
+
'at https://www.google.com/pagead/managed/js/gpt/m202412091001/pubads_impl_page_level_ads.js:1:100',
|
|
71
|
+
'at https://www.googletagmanager.com/gtm.js:1:234',
|
|
72
|
+
'at https://www.google-analytics.com/analytics.js:1:456',
|
|
73
|
+
];
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Sanitize a single stack frame line
|
|
77
|
+
*/
|
|
78
|
+
const sanitizeStackLine = (line) => {
|
|
79
|
+
if (!line || typeof line !== 'string') return line;
|
|
80
|
+
|
|
81
|
+
// Check if this line contains CDP markers
|
|
82
|
+
let hasCDPMarker = false;
|
|
83
|
+
for (const pattern of CDP_MARKER_PATTERNS) {
|
|
84
|
+
pattern.lastIndex = 0; // Reset regex state
|
|
85
|
+
if (pattern.test(line)) {
|
|
86
|
+
hasCDPMarker = true;
|
|
87
|
+
break;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// If line has CDP markers, replace the entire line with a realistic one
|
|
92
|
+
// or just the marker portion
|
|
93
|
+
if (hasCDPMarker) {
|
|
94
|
+
// If the line is mostly anonymous/CDP content, skip it entirely
|
|
95
|
+
if (line.includes('<anonymous>:') && !line.includes('http')) {
|
|
96
|
+
return null; // Mark for removal
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// Otherwise, sanitize the markers
|
|
100
|
+
let sanitized = line;
|
|
101
|
+
for (const pattern of CDP_MARKER_PATTERNS) {
|
|
102
|
+
pattern.lastIndex = 0;
|
|
103
|
+
sanitized = sanitized.replace(pattern, '');
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// Clean up any double spaces or empty parentheses
|
|
107
|
+
sanitized = sanitized
|
|
108
|
+
.replace(/\\(\\s*\\)/g, '')
|
|
109
|
+
.replace(/\\s+/g, ' ')
|
|
110
|
+
.trim();
|
|
111
|
+
|
|
112
|
+
// If line is now too short to be meaningful, skip it
|
|
113
|
+
if (sanitized.length < 10 || sanitized === 'at') {
|
|
114
|
+
return null;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
return sanitized;
|
|
18
118
|
}
|
|
19
|
-
|
|
119
|
+
|
|
120
|
+
return line;
|
|
20
121
|
};
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
window.Error = new Proxy(originalError, {
|
|
28
|
-
construct(target, args) {
|
|
29
|
-
const error = Reflect.construct(target, args);
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Comprehensively sanitize a stack trace
|
|
125
|
+
*/
|
|
126
|
+
const sanitizeStack = (stack) => {
|
|
127
|
+
if (!stack || typeof stack !== 'string') return stack;
|
|
30
128
|
|
|
31
|
-
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
129
|
+
const lines = stack.split('\\n');
|
|
130
|
+
const sanitizedLines = [];
|
|
131
|
+
let removedCount = 0;
|
|
132
|
+
|
|
133
|
+
for (let i = 0; i < lines.length; i++) {
|
|
134
|
+
const line = lines[i];
|
|
135
|
+
const sanitized = sanitizeStackLine(line);
|
|
136
|
+
|
|
137
|
+
if (sanitized === null) {
|
|
138
|
+
removedCount++;
|
|
139
|
+
// Don't add too many removed lines in a row
|
|
140
|
+
if (removedCount > 3) continue;
|
|
141
|
+
} else {
|
|
142
|
+
removedCount = 0;
|
|
143
|
+
sanitizedLines.push(sanitized);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// Ensure stack looks natural - should have at least error message + a few frames
|
|
148
|
+
if (sanitizedLines.length < 2) {
|
|
149
|
+
// Add some realistic frames if stack is too short
|
|
150
|
+
sanitizedLines.push(' at HTMLDocument.<anonymous> (https://www.example.com/:1:100)');
|
|
41
151
|
}
|
|
42
152
|
|
|
43
|
-
return
|
|
153
|
+
return sanitizedLines.join('\\n');
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
// Override Error.prepareStackTrace if it exists (V8 specific)
|
|
157
|
+
// This is called when stack property is first accessed
|
|
158
|
+
if (Error.prepareStackTrace !== undefined) {
|
|
159
|
+
const originalPrepareStackTrace = Error.prepareStackTrace;
|
|
160
|
+
Error.prepareStackTrace = function(error, structuredStackTrace) {
|
|
161
|
+
// If there's an original prepareStackTrace, use it first
|
|
162
|
+
let stack;
|
|
163
|
+
if (typeof originalPrepareStackTrace === 'function') {
|
|
164
|
+
stack = originalPrepareStackTrace.call(this, error, structuredStackTrace);
|
|
165
|
+
} else {
|
|
166
|
+
// Default V8 formatting
|
|
167
|
+
stack = error.toString() + '\\n' +
|
|
168
|
+
structuredStackTrace.map(frame => {
|
|
169
|
+
const fnName = frame.getFunctionName() || '<anonymous>';
|
|
170
|
+
const fileName = frame.getFileName() || '<anonymous>';
|
|
171
|
+
const lineNumber = frame.getLineNumber() || 0;
|
|
172
|
+
const columnNumber = frame.getColumnNumber() || 0;
|
|
173
|
+
return \` at \${fnName} (\${fileName}:\${lineNumber}:\${columnNumber})\`;
|
|
174
|
+
}).join('\\n');
|
|
175
|
+
}
|
|
176
|
+
return sanitizeStack(stack);
|
|
177
|
+
};
|
|
44
178
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
// Check if this might be a CDP detection attempt
|
|
58
|
-
const stackString = arg.stack.toString();
|
|
59
|
-
if (stackString.includes('Error.captureStackTrace') ||
|
|
60
|
-
stackString.includes('__puppeteer_evaluation_script__')) {
|
|
61
|
-
return arg.toString();
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
return arg;
|
|
65
|
-
});
|
|
66
|
-
return Reflect.apply(fn, thisArg, filteredArgs);
|
|
179
|
+
|
|
180
|
+
// Override Error.prototype.stack getter with comprehensive sanitization
|
|
181
|
+
if (originalErrorStackDesc && originalErrorStackDesc.get) {
|
|
182
|
+
Object.defineProperty(Error.prototype, 'stack', {
|
|
183
|
+
get: function() {
|
|
184
|
+
const stack = originalErrorStackDesc.get.call(this);
|
|
185
|
+
return sanitizeStack(stack);
|
|
186
|
+
},
|
|
187
|
+
set: function(value) {
|
|
188
|
+
if (originalErrorStackDesc.set) {
|
|
189
|
+
// Sanitize before setting too
|
|
190
|
+
originalErrorStackDesc.set.call(this, sanitizeStack(value));
|
|
67
191
|
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
|
|
192
|
+
},
|
|
193
|
+
configurable: true,
|
|
194
|
+
enumerable: false
|
|
195
|
+
});
|
|
71
196
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
197
|
+
|
|
198
|
+
// Also patch Error.captureStackTrace for V8
|
|
199
|
+
if (typeof Error.captureStackTrace === 'function') {
|
|
200
|
+
const originalCaptureStackTrace = Error.captureStackTrace;
|
|
201
|
+
Error.captureStackTrace = function(targetObject, constructorOpt) {
|
|
202
|
+
originalCaptureStackTrace.call(this, targetObject, constructorOpt);
|
|
203
|
+
// Stack will be sanitized when accessed via our getter
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
console.log(DEBUG_PREFIX, '✓ Comprehensive Error stack trace sanitization applied');
|
|
208
|
+
|
|
209
|
+
// =============================================================================
|
|
210
|
+
// PART 2: Console protection
|
|
211
|
+
// Some CDP detection works by examining how Error objects are serialized in console
|
|
212
|
+
// =============================================================================
|
|
213
|
+
|
|
214
|
+
const originalConsole = window.console;
|
|
215
|
+
const consoleMethodsToProtect = ['log', 'warn', 'error', 'info', 'debug', 'trace'];
|
|
216
|
+
|
|
217
|
+
consoleMethodsToProtect.forEach(method => {
|
|
218
|
+
const original = originalConsole[method];
|
|
219
|
+
if (typeof original === 'function') {
|
|
220
|
+
originalConsole[method] = function(...args) {
|
|
221
|
+
// Sanitize Error objects before logging
|
|
222
|
+
const sanitizedArgs = args.map(arg => {
|
|
223
|
+
if (arg instanceof Error) {
|
|
224
|
+
// Clone the error with sanitized stack
|
|
225
|
+
const sanitizedError = new Error(arg.message);
|
|
226
|
+
sanitizedError.name = arg.name;
|
|
227
|
+
// stack will be auto-sanitized by our getter
|
|
228
|
+
return sanitizedError;
|
|
229
|
+
}
|
|
230
|
+
return arg;
|
|
231
|
+
});
|
|
232
|
+
return original.apply(this, sanitizedArgs);
|
|
233
|
+
};
|
|
234
|
+
// Hide the patch
|
|
235
|
+
originalConsole[method].toString = () => \`function \${method}() { [native code] }\`;
|
|
236
|
+
}
|
|
79
237
|
});
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
238
|
+
|
|
239
|
+
console.log(DEBUG_PREFIX, '✓ Console protection applied');
|
|
240
|
+
|
|
241
|
+
// =============================================================================
|
|
242
|
+
// PART 3: Protect against CDP WebSocket detection
|
|
243
|
+
// Some advanced detection tries to find the CDP websocket connection
|
|
244
|
+
// =============================================================================
|
|
245
|
+
|
|
246
|
+
// Override WebSocket to hide CDP connections
|
|
247
|
+
const originalWebSocket = window.WebSocket;
|
|
248
|
+
window.WebSocket = function(url, protocols) {
|
|
249
|
+
// Check if this looks like a CDP connection
|
|
250
|
+
if (url && typeof url === 'string') {
|
|
251
|
+
const lowerUrl = url.toLowerCase();
|
|
252
|
+
if (lowerUrl.includes('devtools') ||
|
|
253
|
+
lowerUrl.includes('/json') ||
|
|
254
|
+
lowerUrl.includes('ws://localhost:') ||
|
|
255
|
+
lowerUrl.includes('ws://127.0.0.1:')) {
|
|
256
|
+
// This might be a CDP detection attempt, proceed but mark it
|
|
257
|
+
// We can't block it as that would break legitimate websockets
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
return new originalWebSocket(url, protocols);
|
|
261
|
+
};
|
|
262
|
+
|
|
263
|
+
window.WebSocket.prototype = originalWebSocket.prototype;
|
|
264
|
+
Object.defineProperty(window.WebSocket, 'name', { value: 'WebSocket' });
|
|
265
|
+
window.WebSocket.toString = () => 'function WebSocket() { [native code] }';
|
|
266
|
+
|
|
267
|
+
console.log(DEBUG_PREFIX, '✓ WebSocket protection applied');
|
|
268
|
+
|
|
269
|
+
} catch (error) {
|
|
270
|
+
console.error(DEBUG_PREFIX, 'Failed to apply bypass:', error.message);
|
|
271
|
+
}
|
|
272
|
+
})();
|
|
273
|
+
`;
|
|
84
274
|
//# sourceMappingURL=runtime-enable-bypass.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-enable-bypass.js","sourceRoot":"","sources":["../../../src/fingerprinting/fingerprint-overrides/runtime-enable-bypass.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"runtime-enable-bypass.js","sourceRoot":"","sources":["../../../src/fingerprinting/fingerprint-overrides/runtime-enable-bypass.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG,GAAW,EAAE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmQ5D,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scroll Humanization Module
|
|
3
|
+
* Simulates realistic scroll behavior for 2024-2025
|
|
4
|
+
*
|
|
5
|
+
* Features:
|
|
6
|
+
* - Natural scroll momentum physics
|
|
7
|
+
* - Reading-speed based scroll patterns
|
|
8
|
+
* - Scroll pause at content sections
|
|
9
|
+
* - Touch-like vs mouse wheel differentiation
|
|
10
|
+
* - CDP-level scroll enhancement
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Scroll configuration
|
|
14
|
+
*/
|
|
15
|
+
interface ScrollConfig {
|
|
16
|
+
/** Base scroll speed in pixels per scroll event */
|
|
17
|
+
baseScrollAmount: number;
|
|
18
|
+
/** Variance in scroll amount */
|
|
19
|
+
scrollVariance: number;
|
|
20
|
+
/** Deceleration factor for momentum scrolling */
|
|
21
|
+
deceleration: number;
|
|
22
|
+
/** Minimum velocity before stopping */
|
|
23
|
+
minVelocity: number;
|
|
24
|
+
/** Reading pause probability (0-1) */
|
|
25
|
+
readingPauseProbability: number;
|
|
26
|
+
/** Reading pause duration range in ms [min, max] */
|
|
27
|
+
readingPauseDuration: [number, number];
|
|
28
|
+
/** Delay between scroll events in ms */
|
|
29
|
+
eventDelay: number;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Generate human-like scroll positions using momentum physics
|
|
33
|
+
*/
|
|
34
|
+
export declare const generateScrollPath: (startY: number, targetY: number, config?: Partial<ScrollConfig>) => {
|
|
35
|
+
y: number;
|
|
36
|
+
delay: number;
|
|
37
|
+
}[];
|
|
38
|
+
/**
|
|
39
|
+
* Create a script that enhances scroll events in the browser
|
|
40
|
+
*/
|
|
41
|
+
export declare const createScrollHumanizationScript: () => string;
|
|
42
|
+
/**
|
|
43
|
+
* CDP-level human-like scroll function
|
|
44
|
+
*/
|
|
45
|
+
export declare const humanScroll: (client: unknown, targetY: number, config?: Partial<ScrollConfig>) => Promise<void>;
|
|
46
|
+
/**
|
|
47
|
+
* Scroll to element with human-like behavior
|
|
48
|
+
*/
|
|
49
|
+
export declare const humanScrollToElement: (client: unknown, selector: string, config?: Partial<ScrollConfig>) => Promise<void>;
|
|
50
|
+
/**
|
|
51
|
+
* Setup scroll humanization at CDP level
|
|
52
|
+
*/
|
|
53
|
+
export declare const setupScrollHumanization: (client: unknown) => Promise<void>;
|
|
54
|
+
export {};
|
|
55
|
+
//# sourceMappingURL=scroll-humanization.d.ts.map
|
|
@@ -0,0 +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,MA0NjD,CAAC;AAOF;;GAEG;AACH,eAAO,MAAM,WAAW,WACZ,OAAO,WACN,MAAM,WACP,OAAO,CAAC,YAAY,CAAC,KAC9B,OAAO,CAAC,IAAI,CA0Dd,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB,WACrB,OAAO,YACL,MAAM,WACR,OAAO,CAAC,YAAY,CAAC,KAC9B,OAAO,CAAC,IAAI,CAuCd,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,uBAAuB,WAAkB,OAAO,KAAG,OAAO,CAAC,IAAI,CAY3E,CAAC"}
|