diff options
author | hackademix | 2018-08-27 00:31:37 +0200 |
---|---|---|
committer | hackademix | 2018-08-27 18:55:00 +0200 |
commit | e2b63cf98204a45f4c55ba446689d20e524c188c (patch) | |
tree | fa9739889307b55777d4b48326bbad38136dabf0 /src/content/embeddingDocument.js | |
parent | 6e80d3f130773fc9a9123c5c4c2e97d63e90fa2a (diff) | |
download | noscript-e2b63cf98204a45f4c55ba446689d20e524c188c.tar.gz noscript-e2b63cf98204a45f4c55ba446689d20e524c188c.tar.xz noscript-e2b63cf98204a45f4c55ba446689d20e524c188c.zip |
Further CSP refactoring and removal of obsolete fallbacks.
Diffstat (limited to 'src/content/embeddingDocument.js')
-rw-r--r-- | src/content/embeddingDocument.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/content/embeddingDocument.js b/src/content/embeddingDocument.js new file mode 100644 index 0000000..75b0db0 --- /dev/null +++ b/src/content/embeddingDocument.js @@ -0,0 +1,20 @@ +if (ns.embeddingDocument) { + ns.on("capabilities", () => { + for (let policyType of ["object", "media"]) { + if (!ns.allows(policyType)) { + let request = { + id: `noscript-${policyType}-doc`, + type: policyType, + url: document.URL, + documentUrl: document.URL, + embeddingDocument: true, + }; + let ph = PlaceHolder.create(policyType, request); + if (ph.replacements.size > 0) { + debug(`Created placeholder for ${policyType} at ${document.URL}`); + seen.record({policyType, request, allowed: false}); + } + } + } + }); +} |