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){
|
fakeGenerator: function(prefs, notify, window, original){
|
||||||
return function toDataURL(){
|
return function toDataURL(){
|
||||||
if (canvasSizeShouldBeFaked(this, prefs)){
|
if (canvasSizeShouldBeFaked(this, prefs)){
|
||||||
notify.call(this, "fakedReadout");
|
var fakeCanvas = getFakeCanvas(window, this, prefs);
|
||||||
return original.apply(getFakeCanvas(window, this, prefs), window.Array.from(arguments));
|
if (fakeCanvas !== this){
|
||||||
|
notify.call(this, "fakedReadout");
|
||||||
|
}
|
||||||
|
return original.apply(fakeCanvas, window.Array.from(arguments));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return original.apply(this, window.Array.from(arguments));
|
return original.apply(this, window.Array.from(arguments));
|
||||||
@ -230,8 +233,11 @@
|
|||||||
fakeGenerator: function(prefs, notify, window, original){
|
fakeGenerator: function(prefs, notify, window, original){
|
||||||
return function toBlob(callback){
|
return function toBlob(callback){
|
||||||
if (canvasSizeShouldBeFaked(this, prefs)){
|
if (canvasSizeShouldBeFaked(this, prefs)){
|
||||||
notify.call(this, "fakedReadout");
|
var fakeCanvas = getFakeCanvas(window, this, prefs);
|
||||||
return original.apply(getFakeCanvas(window, this, prefs), window.Array.from(arguments));
|
if (fakeCanvas !== this){
|
||||||
|
notify.call(this, "fakedReadout");
|
||||||
|
}
|
||||||
|
return original.apply(fakeCanvas, window.Array.from(arguments));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return original.apply(this, window.Array.from(arguments));
|
return original.apply(this, window.Array.from(arguments));
|
||||||
@ -255,8 +261,11 @@
|
|||||||
fakeGenerator: function(prefs, notify, window, original){
|
fakeGenerator: function(prefs, notify, window, original){
|
||||||
return function mozGetAsFile(callback){
|
return function mozGetAsFile(callback){
|
||||||
if (canvasSizeShouldBeFaked(this, prefs)){
|
if (canvasSizeShouldBeFaked(this, prefs)){
|
||||||
notify.call(this, "fakedReadout");
|
var fakeCanvas = getFakeCanvas(window, this, prefs);
|
||||||
return original.apply(getFakeCanvas(window, this, prefs), window.Array.from(arguments));
|
if (fakeCanvas !== this){
|
||||||
|
notify.call(this, "fakedReadout");
|
||||||
|
}
|
||||||
|
return original.apply(fakeCanvas, window.Array.from(arguments));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return original.apply(this, window.Array.from(arguments));
|
return original.apply(this, window.Array.from(arguments));
|
||||||
@ -275,13 +284,13 @@
|
|||||||
fakeGenerator: function(prefs, notify, window, original){
|
fakeGenerator: function(prefs, notify, window, original){
|
||||||
return function getImageData(sx, sy, sw, sh){
|
return function getImageData(sx, sy, sw, sh){
|
||||||
if (!this || canvasSizeShouldBeFaked(this.canvas, prefs)){
|
if (!this || canvasSizeShouldBeFaked(this.canvas, prefs)){
|
||||||
notify.call(this, "fakedReadout");
|
|
||||||
var fakeCanvas;
|
var fakeCanvas;
|
||||||
var context = this;
|
var context = this;
|
||||||
if (this && this.canvas) {
|
if (this && this.canvas) {
|
||||||
fakeCanvas = getFakeCanvas(window, this.canvas, prefs);
|
fakeCanvas = getFakeCanvas(window, this.canvas, prefs);
|
||||||
}
|
}
|
||||||
if (fakeCanvas && fakeCanvas !== this.canvas){
|
if (fakeCanvas && fakeCanvas !== this.canvas){
|
||||||
|
notify.call(this, "fakedReadout");
|
||||||
context = window.HTMLCanvasElement.prototype.getContext.call(
|
context = window.HTMLCanvasElement.prototype.getContext.call(
|
||||||
fakeCanvas,
|
fakeCanvas,
|
||||||
"2d"
|
"2d"
|
||||||
|
@ -14,6 +14,7 @@ Version 0.4.3:
|
|||||||
fixes:
|
fixes:
|
||||||
- page action was not always showing
|
- page action was not always showing
|
||||||
- waiting for settings created error messages in browser console
|
- waiting for settings created error messages in browser console
|
||||||
|
- do not show notifications when canvas faking was aborted
|
||||||
|
|
||||||
Version 0.4.2
|
Version 0.4.2
|
||||||
new features:
|
new features:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user