@fanboynz/network-scanner 2.0.12 → 2.0.13
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/nwss.js +18 -9
- package/package.json +1 -1
package/nwss.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// === Network scanner script (nwss.js) v2.0.
|
|
1
|
+
// === Network scanner script (nwss.js) v2.0.13 ===
|
|
2
2
|
|
|
3
3
|
// puppeteer for browser automation, fs for file system operations, psl for domain parsing.
|
|
4
4
|
// const pLimit = require('p-limit'); // Will be dynamically imported
|
|
@@ -130,7 +130,7 @@ const { navigateWithRedirectHandling, handleRedirectTimeout } = require('./lib/r
|
|
|
130
130
|
const { monitorBrowserHealth, isBrowserHealthy, isQuicklyResponsive, performGroupWindowCleanup, performRealtimeWindowCleanup, trackPageForRealtime, updatePageUsage, cleanupPageBeforeReload } = require('./lib/browserhealth');
|
|
131
131
|
|
|
132
132
|
// --- Script Configuration & Constants ---
|
|
133
|
-
const VERSION = '2.0.
|
|
133
|
+
const VERSION = '2.0.13'; // Script version
|
|
134
134
|
|
|
135
135
|
// get startTime
|
|
136
136
|
const startTime = Date.now();
|
|
@@ -2025,9 +2025,9 @@ function setupFrameHandling(page, forceDebug) {
|
|
|
2025
2025
|
chrome: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36",
|
|
2026
2026
|
chrome_mac: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36",
|
|
2027
2027
|
chrome_linux: "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36",
|
|
2028
|
-
firefox: "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:142.0) Gecko/20100101 Firefox/
|
|
2029
|
-
firefox_mac: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:142.0) Gecko/20100101 Firefox/
|
|
2030
|
-
firefox_linux: "Mozilla/5.0 (X11; Linux x86_64; rv:142.0) Gecko/20100101 Firefox/
|
|
2028
|
+
firefox: "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:142.0) Gecko/20100101 Firefox/143.0",
|
|
2029
|
+
firefox_mac: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:142.0) Gecko/20100101 Firefox/143.0",
|
|
2030
|
+
firefox_linux: "Mozilla/5.0 (X11; Linux x86_64; rv:142.0) Gecko/20100101 Firefox/143.0",
|
|
2031
2031
|
safari: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.6 Safari/605.1.15"
|
|
2032
2032
|
};
|
|
2033
2033
|
curlUserAgent = userAgents[siteConfig.userAgent.toLowerCase()] || '';
|
|
@@ -3278,11 +3278,20 @@ function setupFrameHandling(page, forceDebug) {
|
|
|
3278
3278
|
|
|
3279
3279
|
if (forceDebug) console.log(formatLogMessage('debug', `Standard reload #${i} completed for ${currentUrl}`));
|
|
3280
3280
|
} catch (standardReloadErr) {
|
|
3281
|
-
//
|
|
3282
|
-
|
|
3281
|
+
// Categorize errors into expected vs unexpected
|
|
3282
|
+
const isExpectedError = standardReloadErr.message.includes('timeout') ||
|
|
3283
|
+
standardReloadErr.message.includes('detached Frame') ||
|
|
3284
|
+
standardReloadErr.message.includes('Attempted to use detached') ||
|
|
3285
|
+
standardReloadErr.message.includes('Navigating frame was detached') ||
|
|
3286
|
+
standardReloadErr.message.includes('document invalid') ||
|
|
3287
|
+
standardReloadErr.message.includes('Page document invalid');
|
|
3288
|
+
|
|
3289
|
+
if (!isExpectedError) {
|
|
3290
|
+
// Only warn for truly unexpected errors
|
|
3283
3291
|
console.warn(messageColors.warn(`[standard reload #${i} failed] ${currentUrl}: ${standardReloadErr.message}`));
|
|
3284
3292
|
} else if (forceDebug) {
|
|
3285
|
-
|
|
3293
|
+
// Expected errors only shown in debug mode
|
|
3294
|
+
console.log(formatLogMessage('debug', `[reload #${i}] Expected error for ${currentUrl}: ${standardReloadErr.message}`));
|
|
3286
3295
|
}
|
|
3287
3296
|
|
|
3288
3297
|
// Check if this is a persistent failure that should skip remaining reloads
|
|
@@ -3993,4 +4002,4 @@ function setupFrameHandling(page, forceDebug) {
|
|
|
3993
4002
|
if (forceDebug) console.log(formatLogMessage('debug', `About to exit process...`));
|
|
3994
4003
|
process.exit(0);
|
|
3995
4004
|
|
|
3996
|
-
})();
|
|
4005
|
+
})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fanboynz/network-scanner",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.13",
|
|
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": {
|