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": {
"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": ""
},
"rng_options.persistent": {
@ -203,6 +203,10 @@
"message": "nicht persistent",
"description": ""
},
"rng_options.white": {
"message": "nichts (komplett weiß)",
"description": ""
},
"rng_title": {
"message": "Zufallszahlengenerator",
"description": ""

View File

@ -188,7 +188,7 @@
},
"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": ""
},
"rng_options.persistent": {
@ -203,6 +203,10 @@
"message": "non persistent",
"description": ""
},
"rng_options.white": {
"message": "none (completely white)",
"description": ""
},
"rng_title": {
"message": "Random number generator",
"description": ""

View File

@ -29,6 +29,9 @@
case "constant":
setRandomSupply(randomSupplies.constant);
break;
case "white":
setRandomSupply(randomSupplies.white);
break;
default:
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",
defaultValue: "nonPersistent",
options: ["nonPersistent", "constant", "persistent"]
options: ["white", "nonPersistent", "constant", "persistent"]
},
{
name: "useCanvasCache",

View File

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

View File

@ -3,7 +3,9 @@
"use strict";
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);
crypto.subtle.digest("SHA-256", buffer).then(function(hash){
var chunks = [];