mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2024-12-22 12:50:36 +01:00
Added separate fakeReadout option
This commit is contained in:
parent
7da2a94030
commit
74e86d5d12
Binary file not shown.
@ -133,13 +133,15 @@
|
||||
switch (status){
|
||||
case "allow":
|
||||
return original;
|
||||
case "block":
|
||||
default:
|
||||
return exportFunction(
|
||||
case "fake":
|
||||
return fakeFunction.func? exportFunction(
|
||||
fakeFunction.func,
|
||||
unsafeWindow,
|
||||
fakeFunction.exportOptions
|
||||
);
|
||||
): undef;
|
||||
case "block":
|
||||
default:
|
||||
return undef;
|
||||
}
|
||||
}, unsafeWindow)
|
||||
}
|
||||
@ -183,6 +185,12 @@
|
||||
blockMode.readAPI.status = "block";
|
||||
}
|
||||
});
|
||||
self.port.on("fakeReadout", function(force){
|
||||
if (force || !checkPDF("fakeReadout")){
|
||||
blockMode.getContext.status = "allow";
|
||||
blockMode.readAPI.status = "fake";
|
||||
}
|
||||
});
|
||||
self.port.on("askReadout", function(force, askOnce){
|
||||
if (force || !checkPDF("askReadout")){
|
||||
blockMode.getContext.status = "allow";
|
||||
|
11
lib/main.js
11
lib/main.js
@ -109,6 +109,17 @@
|
||||
mode = "blockReadout";
|
||||
}
|
||||
break;
|
||||
case "fakeReadout":
|
||||
if (whiteList.match(url)){
|
||||
mode = "unblock";
|
||||
}
|
||||
else if (blackList.match(url)){
|
||||
mode = "block";
|
||||
}
|
||||
else {
|
||||
mode = "fakeReadout";
|
||||
}
|
||||
break;
|
||||
case "askReadout":
|
||||
if (whiteList.match(url)){
|
||||
mode = "unblock";
|
||||
|
@ -11,6 +11,7 @@ blockMode_options.block everything= alles blockieren
|
||||
blockMode_options.allow only white list= nur Einträge der Whitelist erlauben
|
||||
blockMode_options.ask for permission= um Erlaubnis fragen
|
||||
blockMode_options.block readout API= Auslese-API blockieren
|
||||
blockMode_options.fake readout API= Auslese-API vortäuschen
|
||||
blockMode_options.ask for readout API permission= bei Auslese-API um Erlaubnis fragen
|
||||
blockMode_options.block only black list= nur Einträge der Blacklist blockieren
|
||||
blockMode_options.allow everything= alles erlauben
|
||||
|
@ -11,6 +11,7 @@ blockMode_options.block everything= block everything
|
||||
blockMode_options.allow only white list= allow only white list
|
||||
blockMode_options.ask for permission= ask for permission
|
||||
blockMode_options.block readout API= block readout API
|
||||
blockMode_options.fake readout API= fake readout API
|
||||
blockMode_options.ask for readout API permission= ask for readout API permission
|
||||
blockMode_options.block only black list= block only black list
|
||||
blockMode_options.allow everything= allow everything
|
||||
|
@ -8,7 +8,7 @@
|
||||
"name": "whiteList",
|
||||
"title": "White list",
|
||||
"type": "string",
|
||||
"value": "kkapsner.de,^https?://(\\\\w+\\\\.)*google.[a-z]+/maps"
|
||||
"value": "kkapsner.de"
|
||||
},
|
||||
{
|
||||
"name": "blackList",
|
||||
@ -38,6 +38,10 @@
|
||||
"value": "blockReadout",
|
||||
"label": "block readout API"
|
||||
},
|
||||
{
|
||||
"value": "fakeReadout",
|
||||
"label": "fake readout API"
|
||||
},
|
||||
{
|
||||
"value": "askReadout",
|
||||
"label": "ask for readout API permission"
|
||||
|
Loading…
x
Reference in New Issue
Block a user