@fanboynz/network-scanner 1.0.66 → 1.0.67
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 +7 -3
- package/package.json +1 -1
package/nwss.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// === Network scanner script (nwss.js) v1.0.
|
|
1
|
+
// === Network scanner script (nwss.js) v1.0.67 ===
|
|
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
|
|
@@ -85,7 +85,7 @@ const { navigateWithRedirectHandling, handleRedirectTimeout } = require('./lib/r
|
|
|
85
85
|
const { monitorBrowserHealth, isBrowserHealthy } = require('./lib/browserhealth');
|
|
86
86
|
|
|
87
87
|
// --- Script Configuration & Constants ---
|
|
88
|
-
const VERSION = '1.0.
|
|
88
|
+
const VERSION = '1.0.67'; // Script version
|
|
89
89
|
|
|
90
90
|
// get startTime
|
|
91
91
|
const startTime = Date.now();
|
|
@@ -1837,10 +1837,14 @@ function setupFrameHandling(page, forceDebug) {
|
|
|
1837
1837
|
page.on('request', request => {
|
|
1838
1838
|
const checkedUrl = request.url();
|
|
1839
1839
|
const checkedHostname = safeGetDomain(checkedUrl, true);
|
|
1840
|
+
const checkedRootDomain = safeGetDomain(checkedUrl, false); // Root domain for first-party detection
|
|
1840
1841
|
// Use effectiveCurrentUrl which gets updated after redirects
|
|
1841
1842
|
// This ensures first-party detection uses the final redirected domain
|
|
1842
1843
|
const effectiveCurrentHostname = safeGetDomain(effectiveCurrentUrl, true);
|
|
1843
|
-
|
|
1844
|
+
const effectiveCurrentRootDomain = safeGetDomain(effectiveCurrentUrl, false); // Root domain for comparison
|
|
1845
|
+
|
|
1846
|
+
// FIXED: Compare root domains instead of full hostnames for first-party detection
|
|
1847
|
+
const isFirstParty = checkedRootDomain && effectiveCurrentRootDomain && checkedRootDomain === effectiveCurrentRootDomain;
|
|
1844
1848
|
|
|
1845
1849
|
// Block infinite iframe loops
|
|
1846
1850
|
const frameUrl = request.frame() ? request.frame().url() : '';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fanboynz/network-scanner",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.67",
|
|
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": {
|