- Created
config.jsonwith enable/disable switches for all 13 data collection modules - Each collector can be individually toggled on or off
- Configuration is persistent and survives application restarts
- Data from each collector is saved to its own folder in
/output/ - Structure:
output/ ├── network/ ├── console/ ├── elements/ ├── scripts/ ├── css/ ├── application/ ├── security/ ├── performance/ ├── accessibility/ ├── media/ ├── webgl/ ├── memory/ ├── serviceWorker/ └── analysis-<timestamp>.json (combined)
src/utils/configManager.ts: Core configuration handling- Functions:
loadConfig()- Load settings from config.jsonisCollectorEnabled(name)- Check if a collector is activeenableCollector(name)- Activate a collectordisableCollector(name)- Deactivate a collectorgetEnabledCollectors()- List active collectorscreateModuleDir(name)- Create module-specific foldersensureModuleDirs()- Initialize all module directories
src/bin/collector-cli.ts: Command-line interface- New npm script:
npm run collectors - Commands:
npm run collectors list # Show all collectors npm run collectors enable <name> # Activate collector npm run collectors disable <name> # Deactivate collector npm run collectors toggle <name> # Toggle on/off npm run collectors status <name> # Check status npm run collectors enable-all # Activate all npm run collectors disable-all # Deactivate all
src/utils/presets.ts: Pre-configured collector profiles- Available presets:
minimal- Network + Console onlyperformance- Performance focusedsecurity- Security focuseddom- DOM and styling focusedfull- All collectors enabled
- Modified
src/main.tsto respect configuration - Only active collectors are initialized
- Network & Console collectors only start if enabled
- Only enabled data is collected and saved
- Each module's data saved to dedicated folder
- Displays enabled collectors at startup
# See status of all collectors
npm run collectors list
# Enable specific collectors
npm run collectors enable network
npm run collectors enable console
# Disable specific collectors
npm run collectors disable memory
npm run collectors disable webgl
# Toggle a collector
npm run collectors toggle performanceMinimal Configuration (Network + Console only):
npm run collectors disable-all
npm run collectors enable network
npm run collectors enable console
npm startPerformance Analysis:
npm run collectors disable-all
npm run collectors enable performance
npm run collectors enable media
npm run collectors enable memory
npm startFull Analysis:
npm run collectors enable-all
npm startAfter running, output is organized as:
/output/network/network-<timestamp>.json- Network data/output/console/console-<timestamp>.json- Console data/output/elements/elements-<timestamp>.json- DOM elements- ... and so on for each enabled collector
/output/analysis-<timestamp>.json- Combined analysis
Each click event also creates:
/output/click-<timestamp>.partial.json- Quick snapshot/output/click-<timestamp>.json- Full analysis- Module-specific folders with click data
Edit config.json to customize:
{
"targetUrl": "https://your-url.com",
"headless": false,
"slowMo": 80,
"collectors": {
"network": { "enabled": true, "description": "..." },
"console": { "enabled": true, "description": "..." },
// ... etc
}
}✅ Granular Control - Enable/disable each collector independently ✅ Organized Output - Each module has dedicated folder ✅ CLI Management - Easy toggle via command line ✅ Persistent Config - Settings saved across runs ✅ Non-blocking - Only runs enabled collectors ✅ Performance - Reduce memory/disk usage by disabling unnecessary collectors ✅ Preset Profiles - Quick setup for common scenarios
New Files:
config.json- Collector configurationsrc/utils/configManager.ts- Configuration managementsrc/utils/presets.ts- Preset profilessrc/bin/collector-cli.ts- CLI toolREADME.md- Updated documentation
Modified Files:
src/main.ts- Added configuration supportpackage.json- Added CLI script
-
Configure collectors via CLI or edit
config.json:npm run collectors list
-
Start extraction with only needed collectors:
npm start
-
Find organized output in
/output/<collector-name>/folders
Enjoy your flexible data collection! 🎉