diff --git a/canvasblocker.xpi b/canvasblocker.xpi index a005165..342772c 100644 Binary files a/canvasblocker.xpi and b/canvasblocker.xpi differ diff --git a/data/inject.js b/data/inject.js index dd09aec..da3599a 100644 --- a/data/inject.js +++ b/data/inject.js @@ -37,6 +37,10 @@ var oldBorder = this.style.border; this.style.border = "2px dashed red"; var confirmText = "askForPermission"; + // try {throw new Error();} + // catch (e){ + // console.log(e.stack.split(/\s*(?:-?>|@)\s*/)); + // } var allow = confirm(confirmText); this.style.border = oldBorder; if (allow){ diff --git a/lib/main.js b/lib/main.js index c985a74..23201fb 100644 --- a/lib/main.js +++ b/lib/main.js @@ -55,7 +55,7 @@ updateWhiteList(); preferences.on("whiteList", function(){ updateWhiteList(); - workers.forEach(checkWorker); + // workers.forEach(checkWorker); }); var blackList; @@ -65,23 +65,24 @@ updateBlackList(); preferences.on("blackList", function(){ updateBlackList(); - workers.forEach(checkWorker); + // workers.forEach(checkWorker); }); - preferences.on("blockMode", function(){ - workers.forEach(checkWorker); - });preferences.on("allowPDFCanvas", function(){ - workers.forEach(checkWorker); - }); + // preferences.on("blockMode", function(){ + // workers.forEach(checkWorker); + // }); + // preferences.on("allowPDFCanvas", function(){ + // workers.forEach(checkWorker); + // }); - var workers = []; - function detachWorker(worker, workerArray) { - var index = workerArray.indexOf(worker); - if (index != -1){ - workerArray.splice(index, 1); - } - } + // var workers = []; + // function detachWorker(worker, workerArray) { + // var index = workerArray.indexOf(worker); + // if (index !== -1){ + // workerArray.splice(index, 1); + // } + // } function checkWorker(worker){ var url = new URL(worker.url); switch (prefs.blockMode){ @@ -141,10 +142,10 @@ contentScriptFile: self.data.url("inject.js"), onAttach: function(worker){ - workers.push(worker); - worker.on("detach", function(){ - detachWorker(this, workers); - }); + // workers.push(worker); + // worker.on("detach", function(){ + // detachWorker(this, workers); + // }); worker.port.on("isPDF", function(blocking){ if (prefs.allowPDFCanvas){ worker.port.emit("unblock");