(findings)
| 484 | } |
| 485 | |
| 486 | function updateBadge(findings) { |
| 487 | const total = findings.params.length + findings.headers.length + findings.paths.length; |
| 488 | const all = [...findings.params, ...findings.headers, ...findings.paths]; |
| 489 | const hasCritical = all.some(f => f.severity === 'critical'); |
| 490 | const hasHigh = all.some(f => f.severity === 'high'); |
| 491 | |
| 492 | let color = '#3498db'; |
| 493 | if (hasCritical) color = '#e74c3c'; |
| 494 | else if (hasHigh) color = '#e67e22'; |
| 495 | |
| 496 | chrome.action.setBadgeText({ text: total > 0 ? total.toString() : '' }); |
| 497 | chrome.action.setBadgeBackgroundColor({ color }); |
| 498 | } |
| 499 | |
| 500 | // ============================================================================ |
| 501 | // SCAN STATUS |
no outgoing calls
no test coverage detected