summaryrefslogtreecommitdiff
path: root/src/bg/RequestGuard.js
diff options
context:
space:
mode:
authorhackademix2018-07-26 19:33:46 +0200
committerhackademix2018-07-26 19:33:46 +0200
commitd3cacf634fad5a80c8a715df60d3e53f008252df (patch)
tree377b4f57c20a3f64b8d5f4a754a0aafe6cb61b9c /src/bg/RequestGuard.js
parenta8a6dd4c7bd47ff6960fd71d1a20d151fa08de12 (diff)
downloadnoscript-d3cacf634fad5a80c8a715df60d3e53f008252df.tar.gz
noscript-d3cacf634fad5a80c8a715df60d3e53f008252df.tar.xz
noscript-d3cacf634fad5a80c8a715df60d3e53f008252df.zip
More edge cases covered in dynamic script injection.
Diffstat (limited to 'src/bg/RequestGuard.js')
-rw-r--r--src/bg/RequestGuard.js16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/bg/RequestGuard.js b/src/bg/RequestGuard.js
index 5220658..5a281fb 100644
--- a/src/bg/RequestGuard.js
+++ b/src/bg/RequestGuard.js
@@ -99,12 +99,14 @@ var RequestGuard = (() => {
}
}
let collection = records[what];
- if (type in collection) {
- if (!collection[type].includes(requestKey)) {
- collection[type].push(requestKey);
+ if (collection) {
+ if (type in collection) {
+ if (!collection[type].includes(requestKey)) {
+ collection[type].push(requestKey);
+ }
+ } else {
+ collection[type] = [requestKey];
}
- } else {
- collection[type] = [requestKey];
}
return records;
},
@@ -425,12 +427,12 @@ var RequestGuard = (() => {
}
if (!capabilities.has("media")) {
RequestUtil.executeOnStart(request, {
- code: "window.mediaBlocker = true;"
+ code: "window.mediaBlocker = correctFrame();"
});
}
RequestUtil.executeOnStart(request, {
- file: "content/media.js"
+ file: "/content/media.js"
});
} else if (request.type === "main_frame" && !TabStatus.map.has(tabId)) {
debug("No TabStatus data yet for noscriptFrame", tabId);