MCPcopy Index your code
hub / github.com/devploit/debugHunter / scanUrl

Function scanUrl

background.js:884–911  ·  view source on GitHub ↗
(url)

Source from the content-addressed store, hash-verified

882// ============================================================================
883
884async function scanUrl(url) {
885 if (!await shouldScanUrl(url)) return;
886
887 const domain = new URL(url).hostname;
888 updateScanStatus({ active: true, domain });
889
890 console.log(`%c[debugHunter] Scanning: ${url}`, 'background: #9b59b6; color: white; padding: 2px 6px; border-radius: 3px');
891
892 const settings = await getSettings();
893
894 // Get baseline once for params and headers (saves 1 request)
895 const baseline = await getUrlBaseline(url);
896
897 // Run checks based on maxConcurrent setting
898 if (settings.maxConcurrent >= 3) {
899 await Promise.all([
900 checkParams(url, baseline),
901 checkHeaders(url, baseline),
902 checkPaths(url) // Paths uses domain baseline, not URL baseline
903 ]);
904 } else {
905 await checkParams(url, baseline);
906 await checkHeaders(url, baseline);
907 await checkPaths(url);
908 }
909
910 updateScanStatus({ active: false, domain: '' });
911}
912
913// ============================================================================
914// EVENT LISTENERS

Callers 1

background.jsFile · 0.85

Calls 7

shouldScanUrlFunction · 0.85
updateScanStatusFunction · 0.85
getSettingsFunction · 0.85
getUrlBaselineFunction · 0.85
checkParamsFunction · 0.85
checkHeadersFunction · 0.85
checkPathsFunction · 0.85

Tested by

no test coverage detected