From b6d08459a56923146f8c7d74306c8daa7c2f5333 Mon Sep 17 00:00:00 2001 From: kkapsner Date: Sat, 22 Oct 2016 13:32:48 +0200 Subject: [PATCH] Preworks for the new "fake-input" mode. --- lib/check.js | 11 +++++++---- locale/de-DE.json | 3 +++ locale/en-US.json | 3 +++ package.json | 4 ++++ 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/lib/check.js b/lib/check.js index d967af5..e63ce1d 100644 --- a/lib/check.js +++ b/lib/check.js @@ -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"; } diff --git a/locale/de-DE.json b/locale/de-DE.json index c55587f..2cc8471 100644 --- a/locale/de-DE.json +++ b/locale/de-DE.json @@ -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", diff --git a/locale/en-US.json b/locale/en-US.json index 6020a90..59844ce 100644 --- a/locale/en-US.json +++ b/locale/en-US.json @@ -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", diff --git a/package.json b/package.json index 07b6eb6..9817ac6 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,10 @@ "value": "fakeReadout", "label": "fake readout API" }, + { + "value": "fakeInput", + "label": "fake input API" + }, { "value": "askReadout", "label": "ask for readout API permission"