From e5e38e148e1a031431e28bf9e809bb2ab92b2fff Mon Sep 17 00:00:00 2001 From: kkapsner Date: Sat, 23 Sep 2017 23:34:29 +0200 Subject: [PATCH] Made the domain rnd setable for the persistent rng. --- lib/randomSupplies.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/randomSupplies.js b/lib/randomSupplies.js index 617c4f0..0c5b95b 100644 --- a/lib/randomSupplies.js +++ b/lib/randomSupplies.js @@ -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);