From 21810063d0851fb88623d0458fa4fc2cd054b0db Mon Sep 17 00:00:00 2001 From: hackademix Date: Thu, 26 Jul 2018 23:23:11 +0200 Subject: Disable scripting in HTML-embedding objects where webglHook cannot run, if webgl not allowed. --- src/content/content.js | 4 ++-- src/content/media.js | 2 +- src/content/webglHook.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/content') diff --git a/src/content/content.js b/src/content/content.js index dd847f0..aea705e 100644 --- a/src/content/content.js +++ b/src/content/content.js @@ -100,8 +100,8 @@ async function init(oldPage = false) { } queryingCanScript = true; - debug(`init() called in document %s, contentType %s readyState %s`, - document.URL, document.contentType, document.readyState); + debug(`init() called in document %s, contentType %s readyState %s, frameElement %o`, + document.URL, document.contentType, document.readyState, window.frameElement && frameElement.data); try { let {canScript, shouldScript} = await browser.runtime.sendMessage({type: "canScript"}); diff --git a/src/content/media.js b/src/content/media.js index ead6e05..5a6827a 100644 --- a/src/content/media.js +++ b/src/content/media.js @@ -1,4 +1,4 @@ -if (correctFrame()) { +{ debug("Media Hook (blocked %s)", !!window.mediaBlocker, document.URL, document.documentElement && document.documentElement.innerHTML); (() => { let unpatched = new Map(); diff --git a/src/content/webglHook.js b/src/content/webglHook.js index 39637e2..171ce59 100644 --- a/src/content/webglHook.js +++ b/src/content/webglHook.js @@ -1,4 +1,4 @@ -if (correctFrame()) { +{ debug("WebGL Hook", document.URL, document.documentElement && document.documentElement.innerHTML); let proto = HTMLCanvasElement.prototype; let getContext = proto.getContext; -- cgit v1.2.3