mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2025-01-03 10:31:54 +01:00
Completely remove function monitoring for white listed sites.
Fixes #84.
This commit is contained in:
parent
bda00e5741
commit
fc07961c6b
@ -23,6 +23,7 @@
|
||||
exports.setRandomSupplyByType = setRandomSupplyByType;
|
||||
exports.intercept = function intercept({subject: window}, {check, checkStack, ask, notify, prefs}){
|
||||
var siteStatus = check({url: window.location.href});
|
||||
if (siteStatus.mode !== "allow"){
|
||||
apiNames.forEach(function(name){
|
||||
var changedFunction = changedFunctions[name];
|
||||
var original = window.wrappedJSObject[changedFunction.object].prototype[name];
|
||||
@ -77,5 +78,6 @@
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
}());
|
@ -94,6 +94,7 @@
|
||||
};
|
||||
}
|
||||
else {
|
||||
var status = Object.create(status);
|
||||
status.active = false;
|
||||
return status;
|
||||
}
|
||||
@ -109,6 +110,7 @@
|
||||
},
|
||||
toDataURL: {
|
||||
getStatus: function(obj, status){
|
||||
var status = Object.create(status);
|
||||
if (hasType(status, "input")){
|
||||
var contextType = canvasContextType.get(obj);
|
||||
status.active = contextType !== "2d";
|
||||
@ -129,6 +131,7 @@
|
||||
},
|
||||
toBlob: {
|
||||
getStatus: function(obj, status){
|
||||
var status = Object.create(status);
|
||||
if (hasType(status, "input")){
|
||||
var contextType = canvasContextType.get(obj);
|
||||
status.active = contextType !== "2d";
|
||||
@ -150,6 +153,7 @@
|
||||
},
|
||||
mozGetAsFile: {
|
||||
getStatus: function(obj, status){
|
||||
var status = Object.create(status);
|
||||
if (hasType(status, "input")){
|
||||
var contextType = canvasContextType.get(obj);
|
||||
status.active = contextType !== "2d";
|
||||
@ -170,6 +174,7 @@
|
||||
},
|
||||
getImageData: {
|
||||
getStatus: function(obj, status){
|
||||
var status = Object.create(status);
|
||||
if (hasType(status, "input")){
|
||||
var contextType = canvasContextType.get(obj);
|
||||
status.active = contextType !== "2d";
|
||||
@ -207,6 +212,7 @@
|
||||
},
|
||||
fillText: {
|
||||
getStatus: function(obj, status){
|
||||
var status = Object.create(status);
|
||||
status.active = hasType(status, "input");
|
||||
return status;
|
||||
},
|
||||
@ -225,6 +231,7 @@
|
||||
},
|
||||
strokeText: {
|
||||
getStatus: function(obj, status){
|
||||
var status = Object.create(status);
|
||||
status.active = hasType(status, "input");
|
||||
return status;
|
||||
},
|
||||
@ -243,6 +250,7 @@
|
||||
},
|
||||
readPixels: {
|
||||
getStatus: function(obj, status){
|
||||
var status = Object.create(status);
|
||||
status.active = hasType(status, "readout") || hasType(status, "input");
|
||||
return status;
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user