From 82bed35e6cf761f78925e7450fa155baa231e22e Mon Sep 17 00:00:00 2001 From: hackademix Date: Sun, 25 Nov 2018 23:00:08 +0100 Subject: Limit fix for issue #41 to origin-less fetch (exclude frames). --- src/bg/RequestGuard.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/bg/RequestGuard.js b/src/bg/RequestGuard.js index 8214a3d..92f32b0 100644 --- a/src/bg/RequestGuard.js +++ b/src/bg/RequestGuard.js @@ -263,8 +263,9 @@ var RequestGuard = (() => { let policyType = policyTypesMap[request.type]; if (policyType) { let {url, originUrl, documentUrl} = request; - if (("fetch" === policyType || "frame" === policyType) && - (((!originUrl || url === originUrl) && originUrl === documentUrl + let isFetch = "fetch" === policyType; + if ((isFetch || "frame" === policyType) && + (((isFetch && !originUrl || url === originUrl) && originUrl === documentUrl // some extensions make them both undefined, // see https://github.com/eight04/image-picka/issues/150 ) || -- cgit v1.2.3