mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2025-01-03 10:31:54 +01:00
parent
d8a5cf2283
commit
c3c6c7a2e9
@ -5,6 +5,8 @@
|
|||||||
(function(){
|
(function(){
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
|
let Cu = require("chrome").Cu;
|
||||||
|
|
||||||
var randomSupply = null;
|
var randomSupply = null;
|
||||||
|
|
||||||
function getContext(window, canvas){
|
function getContext(window, canvas){
|
||||||
@ -257,10 +259,19 @@
|
|||||||
object: "WebGLRenderingContext",
|
object: "WebGLRenderingContext",
|
||||||
fakeGenerator: function(prefs, notify){
|
fakeGenerator: function(prefs, notify){
|
||||||
return function readPixels(x, y, width, height, format, type, pixels){
|
return function readPixels(x, y, width, height, format, type, pixels){
|
||||||
|
// not able to use the getFakeCanvas function because the context type is wrong...
|
||||||
notify("fakedReadout");
|
notify("fakedReadout");
|
||||||
|
var xPixels = Cu.waiveXrays(pixels);
|
||||||
var window = getWindow(this.canvas);
|
var window = getWindow(this.canvas);
|
||||||
var context = window.HTMLCanvasElement.prototype.getContext.call(getFakeCanvas(window, this.canvas), "webGL");
|
var ret = window.WebGLRenderingContext.prototype.readPixels.apply(this, arguments);
|
||||||
return window.WebGLRenderingContext.prototype.readPixels.apply(context, arguments);
|
var l = xPixels.length;
|
||||||
|
var rng = randomSupply.getRng(l, window);
|
||||||
|
|
||||||
|
for (var i = 0; i < l; i += 1){
|
||||||
|
xPixels[i] = rng(xPixels[i], i);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@ Version 0.3.4:
|
|||||||
- different fake modes show independent notifications
|
- different fake modes show independent notifications
|
||||||
|
|
||||||
fixes:
|
fixes:
|
||||||
|
- bug in readPixels (prevented google street view to work)
|
||||||
- performance issues
|
- performance issues
|
||||||
- German translations
|
- German translations
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user