Include ServiceWorker-initiated fetch requests in UI reporting (thanks 0_o for report).

This commit is contained in:
hackademix 2022-03-15 09:21:07 +01:00
parent ac9237f565
commit 1e96503130
1 changed files with 3 additions and 2 deletions

View File

@ -303,8 +303,9 @@ var RequestGuard = (() => {
type, url, documentUrl, originUrl
};
if (tabId < 0) {
if (type === "script" && url.startsWith("https://") && documentUrl && documentUrl.startsWith("https://")) {
// service worker / importScripts()?
if ((policyType === "script" || policyType === "fetch") &&
url.startsWith("https://") && documentUrl && documentUrl.startsWith("https://")) {
// service worker request ?
let payload = {request, allowed, policyType, serviceWorker: Sites.origin(documentUrl)};
let recipient = {frameId: 0};
for (let tabId of TabStatus.findTabsByOrigin(payload.serviceWorker)) {