@fanboynz/network-scanner 2.0.59 → 2.0.61
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/CHANGELOG.md +51 -0
- package/README.md +51 -1
- package/lib/adblock.js +215 -179
- package/lib/colorize.js +3 -1
- package/lib/compare.js +19 -32
- package/lib/domain-cache.js +9 -7
- package/lib/fingerprint.js +41 -11
- package/lib/grep.js +9 -13
- package/lib/nettools.js +177 -42
- package/lib/output.js +17 -30
- package/nwss.js +290 -62
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,57 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to the Network Scanner (nwss.js) project.
|
|
4
4
|
|
|
5
|
+
## [2.0.61] - 2026-03-17
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- `.nwssconfig` file for per-config-file CLI settings — define output, concurrency, flags per JSON config
|
|
9
|
+
- `--no-color` / `--no-colour` flag to disable colors (colors now enabled by default)
|
|
10
|
+
- Navigation timeout fallback — retries with `waitUntil: networkidle2` on timeout, 10s cap
|
|
11
|
+
- Skip domains after 3 consecutive timeouts in the same scan to avoid wasting time on down sites
|
|
12
|
+
- Fingerprint cache capped at 500 entries with LRU eviction
|
|
13
|
+
|
|
14
|
+
### Fixed
|
|
15
|
+
- `chrome-error://` popup redirects no longer throw errors — continue processing captured requests
|
|
16
|
+
- Suppressed noisy `about:blank` and `chrome-error://` redirect warnings (visible with `--debug` only)
|
|
17
|
+
- Fallback retry skipped for `chrome-error://` redirects (instant failure, not genuine timeout)
|
|
18
|
+
- Page URL checked before fallback retry to detect already-failed state
|
|
19
|
+
- `.nwssconfig` keys support both hyphens and underscores (`dns-cache` and `dns_cache` both work)
|
|
20
|
+
|
|
21
|
+
### Improved
|
|
22
|
+
- Colors enabled by default — no need for `--color` flag or `color: true` in `.nwssconfig`
|
|
23
|
+
- Chrome UA bumped to 146, Firefox UA bumped to 148
|
|
24
|
+
- Sec-CH-UA headers updated to match Chrome 146
|
|
25
|
+
|
|
26
|
+
## [2.0.60] - 2026-03-16
|
|
27
|
+
|
|
28
|
+
### Added
|
|
29
|
+
- `--dns-cache` flag for persistent dig/whois disk caching between runs (`.digcache`, `.whoiscache`)
|
|
30
|
+
- `--load-extension <path>` flag to load unpacked Chrome extensions (supports multiple)
|
|
31
|
+
- `--block-ads` now supports comma-separated list files (`--block-ads=easylist.txt,easyprivacy.txt`)
|
|
32
|
+
- `disable_ad_tagging` config option to control Chrome AdTagging (default: true)
|
|
33
|
+
- DNS cache hit/miss statistics in scan summary output with fresh domain names listed
|
|
34
|
+
- Concurrent dig/whois deduplication — multiple pages requesting the same domain share one lookup
|
|
35
|
+
- SIGINT/SIGTERM handlers for `--keep-open` to prevent orphaned Chrome processes
|
|
36
|
+
|
|
37
|
+
### Fixed
|
|
38
|
+
- Adblock pipe (`|`) character handling — mid-pattern pipes were incorrectly treated as anchors, causing broad false positives on EasyList rules like `/addyn|*|adtech;`
|
|
39
|
+
- Domain Map fast path was skipping resource type checks — `$ping`, `$script` etc. now correctly enforced
|
|
40
|
+
- Domain extraction for `||domain.com/path` rules — path was incorrectly included in domain name
|
|
41
|
+
- `--keep-open` now skips extension-blocking Chrome flags so Chrome Web Store and extensions work
|
|
42
|
+
- Corrupt disk cache files are deleted instead of persisted
|
|
43
|
+
- `getBaseDomain()` now uses `psl` for correct multi-part TLD handling (`.co.uk`, `.com.au`)
|
|
44
|
+
- Merged 7 separate `--disable-features` flags into one — Chrome only reads the last occurrence
|
|
45
|
+
|
|
46
|
+
### Improved
|
|
47
|
+
- `$document` rules treated as full domain blocks (matches all resource types)
|
|
48
|
+
- `adblock.js`: regex cache for compiled patterns, Set for resource type lookups, lazy parentDomains, two-level result cache with LRU eviction (32K), hoisted constants, freed parsed options after rule parsing
|
|
49
|
+
- `output.js`: capped wildcard regex cache at 500, simplified `*.domain.com` suffix matching, hoisted resource type map
|
|
50
|
+
- `compare.js`: pre-compiled and deduplicated 6 normalization regexes
|
|
51
|
+
- `grep.js`: build grep args once outside pattern loop
|
|
52
|
+
- `domain-cache.js`: use Set iterator for eviction instead of full array copy
|
|
53
|
+
- `nettools.js`: hoisted ANSI strip regex, disk cache flushes once on exit instead of per-lookup
|
|
54
|
+
- Dig/whois cache: 14-hour TTL, 1000 entry limit, pretty-printed JSON files
|
|
55
|
+
|
|
5
56
|
## [2.0.59] - 2026-03-15
|
|
6
57
|
|
|
7
58
|
### Added
|
package/README.md
CHANGED
|
@@ -29,7 +29,7 @@ A Puppeteer-based tool for scanning websites to find third-party (or optionally
|
|
|
29
29
|
|:---------------------------|:------------|
|
|
30
30
|
| `-o, --output <file>` | Output file for rules. If omitted, prints to console |
|
|
31
31
|
| `--compare <file>` | Remove rules that already exist in this file before output |
|
|
32
|
-
| `--color, --colour`
|
|
32
|
+
| `--no-color, --no-colour` | Disable colored console output (colors enabled by default) |
|
|
33
33
|
| `--append` | Append new rules to output file instead of overwriting (requires `-o`) |
|
|
34
34
|
|
|
35
35
|
### Output Format Options
|
|
@@ -64,6 +64,9 @@ A Puppeteer-based tool for scanning websites to find third-party (or optionally
|
|
|
64
64
|
| `--headful` | Launch browser with GUI (not headless) |
|
|
65
65
|
| `--keep-open` | Keep browser and tabs open after scan completes (use with `--headful` for debugging) |
|
|
66
66
|
| `--use-puppeteer-core` | Use `puppeteer-core` with system Chrome instead of bundled Chromium |
|
|
67
|
+
| `--load-extension <path>` | Load unpacked Chrome extension from directory (can be used multiple times) |
|
|
68
|
+
| `--dns-cache` | Persist dig/whois results to disk between runs (14hr TTL, `.digcache`/`.whoiscache`) |
|
|
69
|
+
| `--block-ads=<files>` | Block ads using EasyList format rules (comma-separated: `easylist.txt,easyprivacy.txt`) |
|
|
67
70
|
| `--cdp` | Enable Chrome DevTools Protocol logging (now per-page if enabled) |
|
|
68
71
|
| `--remove-dupes` | Remove duplicate domains from output (only with `-o`) |
|
|
69
72
|
| `--dry-run` | Console output only: show matching regex, titles, whois/dig/searchstring results, and adblock rules |
|
|
@@ -404,6 +407,53 @@ If a proxy fails mid-scan, Chromium's error code is detected and diagnosed:
|
|
|
404
407
|
|
|
405
408
|
Detected error codes: `ERR_PROXY_CONNECTION_FAILED`, `ERR_SOCKS_CONNECTION_FAILED`, `ERR_TUNNEL_CONNECTION_FAILED`, `ERR_PROXY_AUTH_UNSUPPORTED`, `ERR_PROXY_AUTH_REQUESTED`, `ERR_SOCKS_CONNECTION_HOST_UNREACHABLE`, `ERR_PROXY_CERTIFICATE_INVALID`, `ERR_NO_SUPPORTED_PROXIES`.
|
|
406
409
|
|
|
410
|
+
---
|
|
411
|
+
|
|
412
|
+
## .nwssconfig — Per-Config Settings
|
|
413
|
+
|
|
414
|
+
Create a `.nwssconfig` file in the project root to define CLI settings per config file. When a config filename matches a key, those settings are automatically applied. CLI flags merge with and override `.nwssconfig` settings.
|
|
415
|
+
|
|
416
|
+
```json
|
|
417
|
+
{
|
|
418
|
+
"configs": {
|
|
419
|
+
"config-clean1.json": {
|
|
420
|
+
"output": "outputfile.txt",
|
|
421
|
+
"max_concurrent": 30,
|
|
422
|
+
"dns_cache": true,
|
|
423
|
+
"cache_requests": true,
|
|
424
|
+
"dumpurls": true,
|
|
425
|
+
"remove_tempfiles": true,
|
|
426
|
+
"color": true
|
|
427
|
+
},
|
|
428
|
+
"config-clean2.json": {
|
|
429
|
+
"output": "outputfile.txt",
|
|
430
|
+
"max_concurrent": 15,
|
|
431
|
+
"dns_cache": true,
|
|
432
|
+
"cache_requests": true,
|
|
433
|
+
"dumpurls": true,
|
|
434
|
+
"remove_tempfiles": true,
|
|
435
|
+
"color": true,
|
|
436
|
+
"debug": true,
|
|
437
|
+
"block_ads": "easylist.txt,easyprivacy.txt"
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
```
|
|
442
|
+
|
|
443
|
+
**Usage:**
|
|
444
|
+
|
|
445
|
+
```bash
|
|
446
|
+
node nwss.js config-clean1.json # uses .nwssconfig settings
|
|
447
|
+
node nwss.js config-clean2.json --debug # .nwssconfig + debug override
|
|
448
|
+
node nwss.js config-other.json --max-concurrent 5 # no match in .nwssconfig, uses CLI flags
|
|
449
|
+
```
|
|
450
|
+
|
|
451
|
+
**Supported settings:** `output`, `max_concurrent`, `dns_cache`, `cache_requests`, `dumpurls`, `remove_tempfiles`, `color`, `remove_dupes`, `compress_logs`, `debug`, `silent`, `verbose`, `headful`, `keep_open`, `dry_run`, `titles`, `sub_domains`, `no_interact`, `ghost_cursor`, `plain`, `cdp`, `dnsmasq`, `unbound`, `privoxy`, `pihole`, `eval_on_doc`, `use_puppeteer_core`, `ignore_cache`, `clear_cache`, `block_ads`, `compare`, `localhost`, `append`.
|
|
452
|
+
|
|
453
|
+
**Priority:** CLI flags > `.nwssconfig` > hardcoded defaults.
|
|
454
|
+
|
|
455
|
+
---
|
|
456
|
+
|
|
407
457
|
### Global Configuration Options
|
|
408
458
|
|
|
409
459
|
These options go at the root level of your config.json:
|