diff options
author | hackademix | 2018-11-25 23:00:08 +0100 |
---|---|---|
committer | hackademix | 2018-11-25 23:00:08 +0100 |
commit | 82bed35e6cf761f78925e7450fa155baa231e22e (patch) | |
tree | 6177d85c516a26bd4384add6864b4758d7309750 /src | |
parent | d93c87954c3d8792f1d53aaafd8b16885eff4d0a (diff) | |
download | noscript-82bed35e6cf761f78925e7450fa155baa231e22e.tar.gz noscript-82bed35e6cf761f78925e7450fa155baa231e22e.tar.xz noscript-82bed35e6cf761f78925e7450fa155baa231e22e.zip |
Limit fix for issue #41 to origin-less fetch (exclude frames).
Diffstat (limited to 'src')
-rw-r--r-- | src/bg/RequestGuard.js | 5 |
1 files 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 ) || |