diff --git a/canvasblocker.xpi b/canvasblocker.xpi index 837eb5f..3c75b71 100644 Binary files a/canvasblocker.xpi and b/canvasblocker.xpi differ diff --git a/data/inject.js b/data/inject.js index 297ebb7..f039f69 100644 --- a/data/inject.js +++ b/data/inject.js @@ -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"; diff --git a/lib/main.js b/lib/main.js index 712d2b3..ee23e31 100644 --- a/lib/main.js +++ b/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"; diff --git a/locale/de-DE.properties b/locale/de-DE.properties index 1bb896f..1cf7ed2 100644 --- a/locale/de-DE.properties +++ b/locale/de-DE.properties @@ -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 diff --git a/locale/en-US.properties b/locale/en-US.properties index 3f6910a..e989787 100644 --- a/locale/en-US.properties +++ b/locale/en-US.properties @@ -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 diff --git a/package.json b/package.json index 5f4895a..db6f712 100644 --- a/package.json +++ b/package.json @@ -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"