Limit fix for issue #41 to origin-less fetch (exclude frames).

This commit is contained in:
hackademix 2018-11-25 23:00:08 +01:00
parent d93c87954c
commit 82bed35e6c
1 changed files with 3 additions and 2 deletions

View File

@ -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
) ||