diff --git a/canvasblocker.xpi b/canvasblocker.xpi index 12b26bf..1b7861c 100644 Binary files a/canvasblocker.xpi and b/canvasblocker.xpi differ diff --git a/data/inject.js b/data/inject.js index f5c6fbd..ee0495b 100644 --- a/data/inject.js +++ b/data/inject.js @@ -1,4 +1,4 @@ -/* global self, window, console, unsafeWindow, exportFunction, cloneInto */ +/* global self, window, CanvasRenderingContext2D, WebGLRenderingContext, console, unsafeWindow, exportFunction, cloneInto, checkURL, getDomainRegExpList */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ @@ -225,7 +225,7 @@ unsafeWindow, changedFunction.exportOptions ): undef; - case "block": + //case "block": default: return undef; } @@ -265,7 +265,7 @@ switch (mode){ case "block": blockMode.getContext.status = "block"; - blockMode.readAPI.status = "allow"; + blockMode.readAPI.status = "block"; break; case "ask": blockMode.getContext.status = "ask"; diff --git a/lib/main.js b/lib/main.js index a144043..a0091f5 100644 --- a/lib/main.js +++ b/lib/main.js @@ -14,7 +14,6 @@ var URL = require("sdk/url").URL; var _ = require("sdk/l10n").get; var tabUtils = require("sdk/tabs/utils"); - var windowUtils = require("sdk/window/utils"); var sharedFunctions = require("./sharedFunctions.js"); var getDomainRegExpList = sharedFunctions.getDomainRegExpList; @@ -58,7 +57,7 @@ function checkWorker(worker){ try { var mode; - var url = new URL(worker.url) + var url = new URL(worker.url); if ( (url.protocol === "about:") || (prefs.allowPDFCanvas && worker.tab.contentType.match(/\/pdf$/i)) @@ -66,7 +65,7 @@ mode = "unblock"; } else { - var mode = checkURL(url); + mode = checkURL(url); } worker.port.emit(mode, prefs.askOnlyOnce); } @@ -127,12 +126,6 @@ // display notifications worker.port.on("accessed readAPI", function(status, callingStackMsg){ - function log(title, object){ - console.log(title); - for (var name in object){ - console.log(name, object[name]); - } - } switch (status){ case "fake": @@ -181,11 +174,11 @@ } ]; - let priority = notifyBox.PRIORITY_WARNING_MEDIUM; + var priority = notifyBox.PRIORITY_WARNING_MEDIUM; notifyBox.appendNotification( message, - 'fake-readout', - 'chrome://browser/skin/Info.png', + "fake-readout", + "chrome://browser/skin/Info.png", priority, buttons ); diff --git a/lib/sharedFunctions.js b/lib/sharedFunctions.js index ad69c34..8ae3ba6 100644 --- a/lib/sharedFunctions.js +++ b/lib/sharedFunctions.js @@ -1,4 +1,11 @@ +/* global console,exports */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + function getDomainRegExpList(domainList){ + "use strict"; + var list = domainList .split(",") .map(function(entry){ @@ -38,6 +45,8 @@ function getDomainRegExpList(domainList){ } function checkURL(url, blockMode, whiteList, blackList){ + "use strict"; + var mode = "block"; switch (blockMode){ case "blockEverything":