1
0
mirror of https://github.com/kkapsner/CanvasBlocker synced 2024-06-04 12:27:51 +02:00

Added "white" rng

This commit is contained in:
kkapsner 2017-11-24 17:06:43 +01:00
parent 970de1c093
commit 2bc0315c5b
7 changed files with 34 additions and 5 deletions

View File

@ -188,7 +188,7 @@
}, },
"rng_description": { "rng_description": {
"message": "nicht persistent: die Zufallszahlen werden bei jeder Vortäuschaktion neu bestimmt.\nkonstant: innerhalb einer Webseite wird eine Farbe immer gleich verändert.\npersistent: für jede Domain werden die Zufallszahlen nur einmal bestimmt.", "message": "nichts (komplett weiß): es wird immer ein weißes Bild zurückgegeben. Hierbei sollte die Option \"Alpha-Kanal auch vortäuchen\" aktiviert werden. ACHTUNG: Nicht im Modus \"Bei Ausgabe vortäuschen\" verwenden.\nnicht persistent: die Zufallszahlen werden bei jeder Vortäuschaktion neu bestimmt.\nkonstant: innerhalb einer Webseite wird eine Farbe immer gleich verändert.\npersistent: für jede Domain werden die Zufallszahlen nur einmal bestimmt.",
"description": "" "description": ""
}, },
"rng_options.persistent": { "rng_options.persistent": {
@ -203,6 +203,10 @@
"message": "nicht persistent", "message": "nicht persistent",
"description": "" "description": ""
}, },
"rng_options.white": {
"message": "nichts (komplett weiß)",
"description": ""
},
"rng_title": { "rng_title": {
"message": "Zufallszahlengenerator", "message": "Zufallszahlengenerator",
"description": "" "description": ""

View File

@ -188,7 +188,7 @@
}, },
"rng_description": { "rng_description": {
"message": "non persistent: the random numbers will be determined freshly for each faking action.\nconstant: within one web page a color will always be faked to the same color.\npersistent: the random number will only be determined once for every domain.", "message": "none (completely white): a completely white image is returned. The option \"Fake the alpha channel\" should be activated with this. CAUTION: Do not use this with the \"fake at input\" mode.\nnon persistent: the random numbers will be determined freshly for each faking action.\nconstant: within one web page a color will always be faked to the same color.\npersistent: the random number will only be determined once for every domain.",
"description": "" "description": ""
}, },
"rng_options.persistent": { "rng_options.persistent": {
@ -203,6 +203,10 @@
"message": "non persistent", "message": "non persistent",
"description": "" "description": ""
}, },
"rng_options.white": {
"message": "none (completely white)",
"description": ""
},
"rng_title": { "rng_title": {
"message": "Random number generator", "message": "Random number generator",
"description": "" "description": ""

View File

@ -29,6 +29,9 @@
case "constant": case "constant":
setRandomSupply(randomSupplies.constant); setRandomSupply(randomSupplies.constant);
break; break;
case "white":
setRandomSupply(randomSupplies.white);
break;
default: default:
setRandomSupply(randomSupplies.nonPersistent); setRandomSupply(randomSupplies.nonPersistent);
} }

View File

@ -186,4 +186,18 @@
}; };
} }
}; };
scope.white = {
name: "white",
getRng: function(){
return function(){
return 255;
};
},
getPixelRng: function(){
return function(){
return [255, 255, 255, 255];
};
}
};
}()); }());

View File

@ -37,7 +37,7 @@
{ {
name: "rng", name: "rng",
defaultValue: "nonPersistent", defaultValue: "nonPersistent",
options: ["nonPersistent", "constant", "persistent"] options: ["white", "nonPersistent", "constant", "persistent"]
}, },
{ {
name: "useCanvasCache", name: "useCanvasCache",

View File

@ -6,10 +6,12 @@ Version 0.4.3:
- -
new features: new features:
- - reset settings
- new white random generator - creates output similar to Tor browser
fixes: fixes:
- page action was not always showing - page action was not always showing
- waiting for settings created error messages in browser console
Version 0.4.2 Version 0.4.2
new features: new features:

View File

@ -3,7 +3,9 @@
"use strict"; "use strict";
function show(container, url){ function show(container, url){
container.querySelector(".display").src = url; var display = container.querySelector(".display");
display.src = url;
display.title = url;
var buffer = new TextEncoder("utf-8").encode(url); var buffer = new TextEncoder("utf-8").encode(url);
crypto.subtle.digest("SHA-256", buffer).then(function(hash){ crypto.subtle.digest("SHA-256", buffer).then(function(hash){
var chunks = []; var chunks = [];