@fanboynz/network-scanner 2.0.49 → 2.0.50
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/lib/cloudflare.js +1 -21
- package/package.json +1 -1
package/lib/cloudflare.js
CHANGED
|
@@ -368,22 +368,7 @@ async function safePageEvaluate(page, func, timeout = TIMEOUTS.PAGE_EVALUATION_S
|
|
|
368
368
|
}
|
|
369
369
|
|
|
370
370
|
const result = await Promise.race([
|
|
371
|
-
page.evaluate(
|
|
372
|
-
// Additional runtime validation inside evaluation
|
|
373
|
-
try {
|
|
374
|
-
if (typeof window === 'undefined' || !document) {
|
|
375
|
-
throw new Error('Execution context invalid during evaluation');
|
|
376
|
-
}
|
|
377
|
-
return func();
|
|
378
|
-
} catch (evalError) {
|
|
379
|
-
// Return error info instead of throwing to avoid unhandled promise rejections
|
|
380
|
-
return {
|
|
381
|
-
__evaluation_error: true,
|
|
382
|
-
message: evalError.message,
|
|
383
|
-
type: 'evaluation_error'
|
|
384
|
-
};
|
|
385
|
-
}
|
|
386
|
-
}),
|
|
371
|
+
page.evaluate(func),
|
|
387
372
|
new Promise((_, reject) => {
|
|
388
373
|
timeoutId = setTimeout(() => reject(new Error('Page evaluation timeout')), timeout);
|
|
389
374
|
})
|
|
@@ -394,11 +379,6 @@ async function safePageEvaluate(page, func, timeout = TIMEOUTS.PAGE_EVALUATION_S
|
|
|
394
379
|
clearTimeout(timeoutId);
|
|
395
380
|
}
|
|
396
381
|
|
|
397
|
-
// Check if evaluation returned an error
|
|
398
|
-
if (result && result.__evaluation_error) {
|
|
399
|
-
throw new Error(`Evaluation failed: ${result.message}`);
|
|
400
|
-
}
|
|
401
|
-
|
|
402
382
|
if (forceDebug && attempt > 1) {
|
|
403
383
|
console.log(formatLogMessage('cloudflare', `Page evaluation succeeded on attempt ${attempt}`));
|
|
404
384
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fanboynz/network-scanner",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.50",
|
|
4
4
|
"description": "A Puppeteer-based network scanner for analyzing web traffic, generating adblock filter rules, and identifying third-party requests. Features include fingerprint spoofing, Cloudflare bypass, content analysis with curl/grep, and multiple output formats.",
|
|
5
5
|
"main": "nwss.js",
|
|
6
6
|
"scripts": {
|