Allow extensions to perform origin-less fetching and framing (issue #41).

This commit is contained in:
hackademix 2018-11-24 23:43:32 +01:00
parent 1dcbc7ebfc
commit 83979c532e
1 changed files with 4 additions and 1 deletions

View File

@ -264,7 +264,10 @@ var RequestGuard = (() => {
if (policyType) {
let {url, originUrl, documentUrl} = request;
if (("fetch" === policyType || "frame" === policyType) &&
(url === originUrl && originUrl === documentUrl ||
(((!originUrl || url === originUrl) && originUrl === documentUrl
// some extensions make them both undefined,
// see https://github.com/eight04/image-picka/issues/150
) ||
INTERNAL_SCHEME.test(originUrl))
) {
// livemark request or similar browser-internal, always allow;