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();
|
||||
});
|
||||
|
||||
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){
|
||||
|
Loading…
x
Reference in New Issue
Block a user