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}){
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){
return {
type: (match[2] === "Everything" || match[2] === "")?
["context", "readout"]:
["context", "readout", "input"]:
[match[2].toLowerCase()],
mode: match[1]
};
}
else {
return {
type: ["context", "readout"],
type: ["context", "readout", "input"],
mode: "block"
};
}
@ -62,15 +61,19 @@
case "block":
case "blockContext":
case "blockReadout":
case "blockInput":
case "ask":
case "askContext":
case "askReadout":
case "askInput":
case "fake":
case "fakeContext":
case "fakeReadout":
case "fakeInput":
case "allow":
case "allowContext":
case "allowReadout":
case "allowInput":
if (url && lists.get("white").match(url)){
mode = "allow";
}

View File

@ -21,6 +21,7 @@
"blockMode_options.block only black list": "nur Einträge der Blacklist blockieren",
"blockMode_options.block readout API": "Auslese-API blockieren",
"blockMode_options.fake readout API": "Auslese-API vortäuschen",
"blockMode_options.fake input API": "Eingabe-API vortäuschen",
"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.)",
@ -38,6 +39,8 @@
"enableStackList_title": "Dateispezifische Whitelist verwenden",
"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_title": "Ignorierliste",
"ignorelistDomain": "verschweige Domain",

View File

@ -21,6 +21,7 @@
"blockMode_options.block only black list": "block only black list",
"blockMode_options.block readout API": "block readout API",
"blockMode_options.fake readout API": "fake readout API",
"blockMode_options.fake input API": "fake input API",
"blockMode_title": "Block mode",
"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",
"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_title": "Ignore list",
"ignorelistDomain": "silence domain",

View File

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