(url)
| 882 | // ============================================================================ |
| 883 | |
| 884 | async 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 |
no test coverage detected