mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2025-07-04 20:46:39 +02:00
parent
e539a893b4
commit
f75189f374
8 changed files with 224 additions and 95 deletions
|
@ -136,7 +136,7 @@
|
|||
if (prefs("showCallingFile")){
|
||||
msg += parseErrorStack(errorStack).toString(_);
|
||||
}
|
||||
answer = window.confirm(msg)? "allow": "block";
|
||||
answer = window.confirm(msg)? "allow": prefs("askDenyMode");
|
||||
askStatus.alreadyAsked[appearance.text] = true;
|
||||
askStatus.answer[appearance.text] = answer;
|
||||
appearance.reset();
|
||||
|
|
|
@ -62,7 +62,9 @@
|
|||
if (siteStatus.mode !== "allow"){
|
||||
apiNames.forEach(function(name){
|
||||
var changedFunction = changedFunctions[name];
|
||||
if (changedFunction.getStatus(undefined, siteStatus).active){
|
||||
var functionStatus = changedFunction.getStatus(undefined, siteStatus);
|
||||
logging.verbose("status for", name, ":", functionStatus);
|
||||
if (functionStatus.active){
|
||||
(
|
||||
Array.isArray(changedFunction.object)?
|
||||
changedFunction.object:
|
||||
|
|
|
@ -166,7 +166,7 @@
|
|||
}
|
||||
else if (hasType(status, "context") || hasType(status, "input")){
|
||||
return {
|
||||
mode: (status.mode === "block")? "block": "fake",
|
||||
mode: status.mode,
|
||||
type: status.type,
|
||||
active: true
|
||||
};
|
||||
|
@ -189,13 +189,11 @@
|
|||
type: "readout",
|
||||
getStatus: function(obj, status){
|
||||
status = Object.create(status);
|
||||
if (hasType(status, "input")){
|
||||
status.active = hasType(status, "readout");
|
||||
if (!status.active && hasType(status, "input")){
|
||||
var contextType = canvasContextType.get(obj);
|
||||
status.active = contextType !== "2d";
|
||||
}
|
||||
else {
|
||||
status.active = hasType(status, "readout");
|
||||
}
|
||||
return status;
|
||||
},
|
||||
object: "HTMLCanvasElement",
|
||||
|
@ -215,13 +213,11 @@
|
|||
type: "readout",
|
||||
getStatus: function(obj, status){
|
||||
status = Object.create(status);
|
||||
if (hasType(status, "input")){
|
||||
status.active = hasType(status, "readout");
|
||||
if (!status.active && hasType(status, "input")){
|
||||
var contextType = canvasContextType.get(obj);
|
||||
status.active = contextType !== "2d";
|
||||
}
|
||||
else {
|
||||
status.active = hasType(status, "readout");
|
||||
}
|
||||
return status;
|
||||
},
|
||||
object: "HTMLCanvasElement",
|
||||
|
@ -242,13 +238,11 @@
|
|||
type: "readout",
|
||||
getStatus: function(obj, status){
|
||||
status = Object.create(status);
|
||||
if (hasType(status, "input")){
|
||||
status.active = hasType(status, "readout");
|
||||
if (!status.active && hasType(status, "input")){
|
||||
var contextType = canvasContextType.get(obj);
|
||||
status.active = contextType !== "2d";
|
||||
}
|
||||
else {
|
||||
status.active = hasType(status, "readout");
|
||||
}
|
||||
return status;
|
||||
},
|
||||
object: "HTMLCanvasElement",
|
||||
|
|
|
@ -76,6 +76,11 @@
|
|||
name: "askOnlyOnce",
|
||||
defaultValue: true
|
||||
},
|
||||
{
|
||||
name: "askDenyMode",
|
||||
defaultValue: "block",
|
||||
options: ["block", "fake"]
|
||||
},
|
||||
{
|
||||
name: "showNotifications",
|
||||
defaultValue: true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue