mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2024-12-22 12:50:36 +01:00
Code cleanup.
This commit is contained in:
parent
951277e922
commit
6ce7b81124
Binary file not shown.
@ -49,6 +49,7 @@
|
||||
if (url.href === "about:blank"){
|
||||
break;
|
||||
}
|
||||
return "allow";
|
||||
case "chrome:":
|
||||
return "allow";
|
||||
}
|
||||
|
@ -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 @@
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
};
|
||||
}());
|
@ -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){
|
||||
|
33
lib/main.js
33
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());
|
||||
|
@ -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];
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user