summaryrefslogtreecommitdiff
path: root/src/content
diff options
context:
space:
mode:
authorhackademix2018-07-26 19:33:46 +0200
committerhackademix2018-07-26 19:33:46 +0200
commitd3cacf634fad5a80c8a715df60d3e53f008252df (patch)
tree377b4f57c20a3f64b8d5f4a754a0aafe6cb61b9c /src/content
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/content')
-rw-r--r--src/content/media.js7
-rw-r--r--src/content/webglHook.js9
2 files changed, 6 insertions, 10 deletions
diff --git a/src/content/media.js b/src/content/media.js
index b975bef..ead6e05 100644
--- a/src/content/media.js
+++ b/src/content/media.js
@@ -1,5 +1,5 @@
-debug("Media Hook (blocked %s)", !!window.mediaBlocker, document.URL, document.documentElement && document.documentElement.innerHTML);
-try {
+if (correctFrame()) {
+ debug("Media Hook (blocked %s)", !!window.mediaBlocker, document.URL, document.documentElement && document.documentElement.innerHTML);
(() => {
let unpatched = new Map();
function patch(obj, methodName, replacement) {
@@ -56,6 +56,5 @@ try {
});
})();
-} catch (e) {
- error(e, "Cannot patch MediaSource");
+ document.URL;
}
diff --git a/src/content/webglHook.js b/src/content/webglHook.js
index c3b7aaa..39637e2 100644
--- a/src/content/webglHook.js
+++ b/src/content/webglHook.js
@@ -1,5 +1,5 @@
-debug("WebGL Hook", document.URL, document.documentElement && document.documentElement.innerHTML);
-try {
+if (correctFrame()) {
+ debug("WebGL Hook", document.URL, document.documentElement && document.documentElement.innerHTML);
let proto = HTMLCanvasElement.prototype;
let getContext = proto.getContext;
exportFunction(function(type, ...rest) {
@@ -24,8 +24,5 @@ try {
}
return getContext.call(this, type, ...rest);
}, proto, {defineAs: "getContext"});
-} catch (e) {
- console.error(e);
+ document.URL;
}
-
-null;