mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2025-07-03 12:06:31 +02:00
parent
af6fcd8026
commit
7b7583afe0
3 changed files with 13 additions and 3 deletions
|
@ -56,7 +56,7 @@
|
|||
setRandomSupplyByType(prefs("rng"));
|
||||
var fake = changedFunction.fakeGenerator(prefs, function(messageId){
|
||||
notify({url: window.location.href, errorStack: error.stack, messageId});
|
||||
});
|
||||
}, original);
|
||||
switch (fake){
|
||||
case true:
|
||||
return original;
|
||||
|
|
|
@ -187,13 +187,13 @@
|
|||
return status;
|
||||
},
|
||||
object: "CanvasRenderingContext2D",
|
||||
fakeGenerator: function(prefs, notify){
|
||||
fakeGenerator: function(prefs, notify, original){
|
||||
var maxSize = prefs("maxFakeSize") || Number.POSITIVE_INFINITY;
|
||||
return function getImageData(sx, sy, sw, sh){
|
||||
var window = getWindow(this.canvas);
|
||||
var context;
|
||||
if (sw * sh > maxSize){
|
||||
context = this;
|
||||
return original.call(this, sx, sy, sw, sh);
|
||||
}
|
||||
else {
|
||||
notify("fakedReadout");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue