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:
parent
147a2893c4
commit
3c96a9e3f5
10
lib/main.js
10
lib/main.js
@ -72,9 +72,8 @@
|
|||||||
updateBlackList();
|
updateBlackList();
|
||||||
});
|
});
|
||||||
|
|
||||||
function checkWorker(worker){
|
function checkURL(url){
|
||||||
try {
|
var url = new URL(url);
|
||||||
var url = new URL(worker.url);
|
|
||||||
var mode = "block";
|
var mode = "block";
|
||||||
switch (prefs.blockMode){
|
switch (prefs.blockMode){
|
||||||
case "blockEverything":
|
case "blockEverything":
|
||||||
@ -124,6 +123,11 @@
|
|||||||
default:
|
default:
|
||||||
console.log("Unknown blocking mode. Default to block everything.");
|
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);
|
worker.port.emit(mode, false, prefs.askOnlyOnce);
|
||||||
}
|
}
|
||||||
catch (e){
|
catch (e){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user