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(){
|
||||
"use strict";
|
||||
|
||||
let Cu = require("chrome").Cu;
|
||||
|
||||
var randomSupply = null;
|
||||
|
||||
function getContext(window, canvas){
|
||||
@ -257,10 +259,19 @@
|
||||
object: "WebGLRenderingContext",
|
||||
fakeGenerator: function(prefs, notify){
|
||||
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");
|
||||
var xPixels = Cu.waiveXrays(pixels);
|
||||
var window = getWindow(this.canvas);
|
||||
var context = window.HTMLCanvasElement.prototype.getContext.call(getFakeCanvas(window, this.canvas), "webGL");
|
||||
return window.WebGLRenderingContext.prototype.readPixels.apply(context, arguments);
|
||||
var ret = window.WebGLRenderingContext.prototype.readPixels.apply(this, 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
|
||||
|
||||
fixes:
|
||||
- bug in readPixels (prevented google street view to work)
|
||||
- performance issues
|
||||
- German translations
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user