1
0
mirror of https://github.com/kkapsner/CanvasBlocker synced 2025-04-18 08:08:28 +02:00

More flexible list checking

This commit is contained in:
kkapsner 2014-10-11 00:07:51 +02:00
parent 147a2893c4
commit 3c96a9e3f5

View File

@ -72,9 +72,8 @@
updateBlackList();
});
function checkWorker(worker){
try {
var url = new URL(worker.url);
function checkURL(url){
var url = new URL(url);
var mode = "block";
switch (prefs.blockMode){
case "blockEverything":
@ -124,6 +123,11 @@
default:
console.log("Unknown blocking mode. Default to block everything.");
}
return mode;
}
function checkWorker(worker){
try {
var mode = checkURL(worker.url);
worker.port.emit(mode, false, prefs.askOnlyOnce);
}
catch (e){