Fix P2/P3 review findings: DNR redirect format, runtime type guard, cache test setup

This commit is contained in:
2026-05-11 13:54:51 -04:00
parent 726aafef74
commit 0f997b639f
6 changed files with 94 additions and 38 deletions

View File

@@ -44,7 +44,7 @@ export class UrlCache {
}
async loadFromStorage(): Promise<void> {
const data = await chrome.storage.local.get('urlCache');
const data = await chrome.storage.local.get('urlCache') as { urlCache: Record<string, { result: UrlCheckResult; expiresAt: number }> };
if (data.urlCache) {
const now = Date.now();
for (const [key, entry] of Object.entries(data.urlCache)) {