1
0
mirror of https://github.com/kkapsner/CanvasBlocker synced 2024-12-31 17:11:54 +01:00

Added separate fakeReadout option

This commit is contained in:
kkapsner 2014-10-13 01:37:13 +02:00
parent 7da2a94030
commit 74e86d5d12
6 changed files with 30 additions and 5 deletions

Binary file not shown.

View File

@ -133,13 +133,15 @@
switch (status){ switch (status){
case "allow": case "allow":
return original; return original;
case "block": case "fake":
default: return fakeFunction.func? exportFunction(
return exportFunction(
fakeFunction.func, fakeFunction.func,
unsafeWindow, unsafeWindow,
fakeFunction.exportOptions fakeFunction.exportOptions
); ): undef;
case "block":
default:
return undef;
} }
}, unsafeWindow) }, unsafeWindow)
} }
@ -183,6 +185,12 @@
blockMode.readAPI.status = "block"; 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){ self.port.on("askReadout", function(force, askOnce){
if (force || !checkPDF("askReadout")){ if (force || !checkPDF("askReadout")){
blockMode.getContext.status = "allow"; blockMode.getContext.status = "allow";

View File

@ -109,6 +109,17 @@
mode = "blockReadout"; mode = "blockReadout";
} }
break; break;
case "fakeReadout":
if (whiteList.match(url)){
mode = "unblock";
}
else if (blackList.match(url)){
mode = "block";
}
else {
mode = "fakeReadout";
}
break;
case "askReadout": case "askReadout":
if (whiteList.match(url)){ if (whiteList.match(url)){
mode = "unblock"; mode = "unblock";

View File

@ -11,6 +11,7 @@ blockMode_options.block everything= alles blockieren
blockMode_options.allow only white list= nur Einträge der Whitelist erlauben blockMode_options.allow only white list= nur Einträge der Whitelist erlauben
blockMode_options.ask for permission= um Erlaubnis fragen blockMode_options.ask for permission= um Erlaubnis fragen
blockMode_options.block readout API= Auslese-API blockieren 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.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.block only black list= nur Einträge der Blacklist blockieren
blockMode_options.allow everything= alles erlauben blockMode_options.allow everything= alles erlauben

View File

@ -11,6 +11,7 @@ blockMode_options.block everything= block everything
blockMode_options.allow only white list= allow only white list blockMode_options.allow only white list= allow only white list
blockMode_options.ask for permission= ask for permission blockMode_options.ask for permission= ask for permission
blockMode_options.block readout API= block readout API 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.ask for readout API permission= ask for readout API permission
blockMode_options.block only black list= block only black list blockMode_options.block only black list= block only black list
blockMode_options.allow everything= allow everything blockMode_options.allow everything= allow everything

View File

@ -8,7 +8,7 @@
"name": "whiteList", "name": "whiteList",
"title": "White list", "title": "White list",
"type": "string", "type": "string",
"value": "kkapsner.de,^https?://(\\\\w+\\\\.)*google.[a-z]+/maps" "value": "kkapsner.de"
}, },
{ {
"name": "blackList", "name": "blackList",
@ -38,6 +38,10 @@
"value": "blockReadout", "value": "blockReadout",
"label": "block readout API" "label": "block readout API"
}, },
{
"value": "fakeReadout",
"label": "fake readout API"
},
{ {
"value": "askReadout", "value": "askReadout",
"label": "ask for readout API permission" "label": "ask for readout API permission"