diff --git a/canvasblocker.xpi b/CanvasBlocker@kkapsner.de-0.3.0-Development.xpi similarity index 72% rename from canvasblocker.xpi rename to CanvasBlocker@kkapsner.de-0.3.0-Development.xpi index 05c598d..ea26ed4 100644 Binary files a/canvasblocker.xpi and b/CanvasBlocker@kkapsner.de-0.3.0-Development.xpi differ diff --git a/lib/check.js b/lib/check.js index 06181e9..d967af5 100644 --- a/lib/check.js +++ b/lib/check.js @@ -49,6 +49,7 @@ if (url.href === "about:blank"){ break; } + return "allow"; case "chrome:": return "allow"; } diff --git a/lib/intercept.js b/lib/intercept.js index 1d1621d..800abf3 100644 --- a/lib/intercept.js +++ b/lib/intercept.js @@ -1,3 +1,4 @@ +/* jslint moz: true */ /* 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/. */ @@ -47,5 +48,5 @@ } ); }); - } + }; }()); \ No newline at end of file diff --git a/lib/lists.js b/lib/lists.js index b8167b6..20464ce 100644 --- a/lib/lists.js +++ b/lib/lists.js @@ -1,3 +1,4 @@ +/* jslint moz: true */ /* 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/. */ @@ -70,17 +71,18 @@ Object.keys(lists).forEach(function(type){ }); function updateStackList(){ + var list; try { var data = JSON.parse(prefs.stackList); if (!Array.isArray(data)){ data = [data]; } - var list = data.filter(function(entry){ + list = data.filter(function(entry){ return typeof entry === "object" && typeof entry.url === "string"; }); } catch(e){ - var list = []; + list = []; } list.match = function(stack){ return this.some(function(stackRule){ diff --git a/lib/main.js b/lib/main.js index 255b765..4c2b352 100644 --- a/lib/main.js +++ b/lib/main.js @@ -27,39 +27,6 @@ } }; - // const observers = require("sdk/system/events"); - // const {intercept} = require("./intercept"); - // const {errorToCallingStack} = require("./callingStack.js"); - // const {ask} = require("./askForPermission"); - // function interceptWrapper(ev){ - // intercept(ev, { - // check, - // ask: function(data){ - // return ask( - // data, - // { - // _, - // prefs: function(name){ - // return prefs[ev.data]; - // } - // } - // ); - // }, - // notify: function(data, window){ - // notify( - // data, - // { - // lists, _, notificationPref, window - // } - // ); - // } - // }); - // } - // observers.on("content-document-global-created", interceptWrapper); - // unload(function(){ - // observers.off("content-document-global-created", interceptWrapper); - // }); - const {Cc, Ci} = require("chrome"); var globalMM = Cc["@mozilla.org/globalmessagemanager;1"].getService(Ci.nsIMessageListenerManager); var frameURL = require("sdk/self").data.url("frame.js?" + Math.random()); diff --git a/lib/modifiedAPI.js b/lib/modifiedAPI.js index 3e424bd..455661a 100644 --- a/lib/modifiedAPI.js +++ b/lib/modifiedAPI.js @@ -27,7 +27,7 @@ source ); } - var data = imageData.data; + data = imageData.data; for (var i = 0, l = data.length; i < l; i += 1){ var value = source[i]; diff --git a/lib/notifications.js b/lib/notifications.js index c2386e0..3f089e1 100644 --- a/lib/notifications.js +++ b/lib/notifications.js @@ -1,3 +1,4 @@ +/* jslint moz: true */ /* 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/. */ @@ -13,7 +14,7 @@ exports.notify = function({url, errorStack}, {lists, notificationPref, _, browse var contentURL = new URL(url); if (notificationPref.doShow() && !lists.get("ignore").match(contentURL)){ - var url = contentURL.href; + url = contentURL.href; var domain = contentURL.hostname; var message = _("fakedReadout").replace(/\{url\}/g, domain || url);