1
0
mirror of https://github.com/kkapsner/CanvasBlocker synced 2024-12-22 21:00:23 +01:00

Added test page for webGL - it is also working with the webExtension.

This commit is contained in:
kkapsner 2017-06-29 20:19:00 +02:00
parent 0f35d762e2
commit f70380aa67
3 changed files with 24 additions and 2 deletions

View File

@ -297,7 +297,7 @@
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 = pixels//Cu.waiveXrays(pixels);
var xPixels = pixels;
var ret = original.apply(this, window.Array.from(arguments));
var l = xPixels.length;
var rng = randomSupply.getRng(l, window);

View File

@ -1,7 +1,6 @@
Version 0.4.0:
todos:
- import settings in content script (have to wait for the new API to register content scripts)
- check if webGL is still working
- add notification actions to page action popup
changes:
- switched to webExtension
@ -12,6 +11,7 @@ Version 0.4.0:
fixes:
- ask mode did not work for input types
- allow page scripts to overwrite the faked funtions
Version 0.3.8:
changes:

22
test/webGL-Test.html Normal file
View File

@ -0,0 +1,22 @@
<!DOCTYPE html>
<html>
<head>
<title>Test</title>
</head>
<body>
<canvas id="canvas" width="10" height="10"></canvas>
<span id="output"></span>
<script>
(function(){
var canvas = document.getElementById('canvas');
var gl = canvas.getContext('webgl');
var pixels = new Uint8Array(gl.drawingBufferWidth * gl.drawingBufferHeight * 4);
gl.readPixels(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight, gl.RGBA, gl.UNSIGNED_BYTE, pixels);
var values = [];
for (var i = 0; i < pixels.length; i += 1){
values[pixels[i]] = (values[pixels[i]] || 0) + 1;
}
document.getElementById("output").textContent = JSON.stringify(values);
}());
</script>
</body></html>