1
0
mirror of https://github.com/kkapsner/CanvasBlocker synced 2024-12-22 21:00:23 +01:00

Preworks for the new "fake-input" mode.

This commit is contained in:
kkapsner 2016-10-22 13:32:48 +02:00
parent fcedf34b9f
commit b6d08459a5
4 changed files with 17 additions and 4 deletions

View File

@ -14,19 +14,18 @@
exports.check = function check({url, errorStack}){ exports.check = function check({url, errorStack}){
var callingStack = parseErrorStack(errorStack); var callingStack = parseErrorStack(errorStack);
var match = checkBoth(callingStack, url, prefs.blockMode).match(/^(block|allow|fake|ask)(|Readout|Everything|Context)$/); var match = checkBoth(callingStack, url, prefs.blockMode).match(/^(block|allow|fake|ask)(|Readout|Everything|Context|Input)$/);
if (match){ if (match){
return { return {
type: (match[2] === "Everything" || match[2] === "")? type: (match[2] === "Everything" || match[2] === "")?
["context", "readout"]: ["context", "readout", "input"]:
[match[2].toLowerCase()], [match[2].toLowerCase()],
mode: match[1] mode: match[1]
}; };
} }
else { else {
return { return {
type: ["context", "readout"], type: ["context", "readout", "input"],
mode: "block" mode: "block"
}; };
} }
@ -62,15 +61,19 @@
case "block": case "block":
case "blockContext": case "blockContext":
case "blockReadout": case "blockReadout":
case "blockInput":
case "ask": case "ask":
case "askContext": case "askContext":
case "askReadout": case "askReadout":
case "askInput":
case "fake": case "fake":
case "fakeContext": case "fakeContext":
case "fakeReadout": case "fakeReadout":
case "fakeInput":
case "allow": case "allow":
case "allowContext": case "allowContext":
case "allowReadout": case "allowReadout":
case "allowInput":
if (url && lists.get("white").match(url)){ if (url && lists.get("white").match(url)){
mode = "allow"; mode = "allow";
} }

View File

@ -21,6 +21,7 @@
"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.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.fake readout API": "Auslese-API vortäuschen",
"blockMode_options.fake input API": "Eingabe-API vortäuschen",
"blockMode_title": "Blockiermodus", "blockMode_title": "Blockiermodus",
"maxFakeSize_description": "Canvas, die eine größe Fläche als die hier angegeben Zahl haben, werden nicht vorgetäuscht. (Null eingeben, um es zu deaktivieren.)", "maxFakeSize_description": "Canvas, die eine größe Fläche als die hier angegeben Zahl haben, werden nicht vorgetäuscht. (Null eingeben, um es zu deaktivieren.)",
@ -38,6 +39,8 @@
"enableStackList_title": "Dateispezifische Whitelist verwenden", "enableStackList_title": "Dateispezifische Whitelist verwenden",
"fakedReadout": "Auslese vorgetäuscht auf {url}", "fakedReadout": "Auslese vorgetäuscht auf {url}",
"fakedInput": "Eingabe vorgetäuscht auf {url}",
"ignoreList_description": "Domänen oder URLs, bei denen keine Benachrichtigung angezeigt werden. Mehrere Einträge müssen durch ein Komma getrennt werden.", "ignoreList_description": "Domänen oder URLs, bei denen keine Benachrichtigung angezeigt werden. Mehrere Einträge müssen durch ein Komma getrennt werden.",
"ignoreList_title": "Ignorierliste", "ignoreList_title": "Ignorierliste",
"ignorelistDomain": "verschweige Domain", "ignorelistDomain": "verschweige Domain",

View File

@ -21,6 +21,7 @@
"blockMode_options.block only black list": "block only black list", "blockMode_options.block only black list": "block only black list",
"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.fake readout API": "fake readout API",
"blockMode_options.fake input API": "fake input API",
"blockMode_title": "Block mode", "blockMode_title": "Block mode",
"maxFakeSize_description": "Canvas with a bigger area than this number will not be faked. (Enter zero to disable.)", "maxFakeSize_description": "Canvas with a bigger area than this number will not be faked. (Enter zero to disable.)",
@ -38,6 +39,8 @@
"enableStackList_title": "Use file specific white list", "enableStackList_title": "Use file specific white list",
"fakedReadout": "Faked readout on {url}", "fakedReadout": "Faked readout on {url}",
"fakedInput": "Faked input on {url}",
"ignoreList_description": "Domains or URLs where no notification will be shown. To add multiple entries, separate them by commas.", "ignoreList_description": "Domains or URLs where no notification will be shown. To add multiple entries, separate them by commas.",
"ignoreList_title": "Ignore list", "ignoreList_title": "Ignore list",
"ignorelistDomain": "silence domain", "ignorelistDomain": "silence domain",

View File

@ -32,6 +32,10 @@
"value": "fakeReadout", "value": "fakeReadout",
"label": "fake readout API" "label": "fake readout API"
}, },
{
"value": "fakeInput",
"label": "fake input API"
},
{ {
"value": "askReadout", "value": "askReadout",
"label": "ask for readout API permission" "label": "ask for readout API permission"