Made the domain rnd setable for the persistent rng.

This commit is contained in:
kkapsner 2017-09-23 23:34:29 +02:00
parent 07330cbdcf
commit e5e38e148e
1 changed files with 5 additions and 1 deletions

View File

@ -25,8 +25,9 @@
}
return window.location.host;
}
var persistentRnd = Object.create(null);
const getPersistentRnd = (function(){
var persistentRnd = Object.create(null);
browser.runtime.onMessage.addListener(function(data){
if (data["canvasBlocker-set-domain-rnd"]){
@ -51,6 +52,9 @@
}());
scope.persistent = {
name: "persistent",
setDomainRnd: function(domain, rnd){
persistentRnd[domain] = new Uint8Array(rnd);
},
getRng: function(length, window){
var bitSet = getPersistentRnd(window);