mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2025-07-04 20:46:39 +02:00
Preworks for the new "fake-input" mode.
This commit is contained in:
parent
fcedf34b9f
commit
b6d08459a5
4 changed files with 17 additions and 4 deletions
11
lib/check.js
11
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";
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue