mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2025-01-03 10:31:54 +01:00
do not show notifications when canvas faking was aborted
This commit is contained in:
parent
096db123d7
commit
871199cbc3
@ -206,8 +206,11 @@
|
||||
fakeGenerator: function(prefs, notify, window, original){
|
||||
return function toDataURL(){
|
||||
if (canvasSizeShouldBeFaked(this, prefs)){
|
||||
notify.call(this, "fakedReadout");
|
||||
return original.apply(getFakeCanvas(window, this, prefs), window.Array.from(arguments));
|
||||
var fakeCanvas = getFakeCanvas(window, this, prefs);
|
||||
if (fakeCanvas !== this){
|
||||
notify.call(this, "fakedReadout");
|
||||
}
|
||||
return original.apply(fakeCanvas, window.Array.from(arguments));
|
||||
}
|
||||
else {
|
||||
return original.apply(this, window.Array.from(arguments));
|
||||
@ -230,8 +233,11 @@
|
||||
fakeGenerator: function(prefs, notify, window, original){
|
||||
return function toBlob(callback){
|
||||
if (canvasSizeShouldBeFaked(this, prefs)){
|
||||
notify.call(this, "fakedReadout");
|
||||
return original.apply(getFakeCanvas(window, this, prefs), window.Array.from(arguments));
|
||||
var fakeCanvas = getFakeCanvas(window, this, prefs);
|
||||
if (fakeCanvas !== this){
|
||||
notify.call(this, "fakedReadout");
|
||||
}
|
||||
return original.apply(fakeCanvas, window.Array.from(arguments));
|
||||
}
|
||||
else {
|
||||
return original.apply(this, window.Array.from(arguments));
|
||||
@ -255,8 +261,11 @@
|
||||
fakeGenerator: function(prefs, notify, window, original){
|
||||
return function mozGetAsFile(callback){
|
||||
if (canvasSizeShouldBeFaked(this, prefs)){
|
||||
notify.call(this, "fakedReadout");
|
||||
return original.apply(getFakeCanvas(window, this, prefs), window.Array.from(arguments));
|
||||
var fakeCanvas = getFakeCanvas(window, this, prefs);
|
||||
if (fakeCanvas !== this){
|
||||
notify.call(this, "fakedReadout");
|
||||
}
|
||||
return original.apply(fakeCanvas, window.Array.from(arguments));
|
||||
}
|
||||
else {
|
||||
return original.apply(this, window.Array.from(arguments));
|
||||
@ -275,13 +284,13 @@
|
||||
fakeGenerator: function(prefs, notify, window, original){
|
||||
return function getImageData(sx, sy, sw, sh){
|
||||
if (!this || canvasSizeShouldBeFaked(this.canvas, prefs)){
|
||||
notify.call(this, "fakedReadout");
|
||||
var fakeCanvas;
|
||||
var context = this;
|
||||
if (this && this.canvas) {
|
||||
fakeCanvas = getFakeCanvas(window, this.canvas, prefs);
|
||||
}
|
||||
if (fakeCanvas && fakeCanvas !== this.canvas){
|
||||
notify.call(this, "fakedReadout");
|
||||
context = window.HTMLCanvasElement.prototype.getContext.call(
|
||||
fakeCanvas,
|
||||
"2d"
|
||||
|
@ -14,6 +14,7 @@ Version 0.4.3:
|
||||
fixes:
|
||||
- page action was not always showing
|
||||
- waiting for settings created error messages in browser console
|
||||
- do not show notifications when canvas faking was aborted
|
||||
|
||||
Version 0.4.2
|
||||
new features:
|
||||
|
Loading…
x
Reference in New Issue
Block a user