mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2025-01-03 10:31:54 +01:00
Made the domain rnd setable for the persistent rng.
This commit is contained in:
parent
07330cbdcf
commit
e5e38e148e
@ -25,8 +25,9 @@
|
|||||||
}
|
}
|
||||||
return window.location.host;
|
return window.location.host;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var persistentRnd = Object.create(null);
|
||||||
const getPersistentRnd = (function(){
|
const getPersistentRnd = (function(){
|
||||||
var persistentRnd = Object.create(null);
|
|
||||||
|
|
||||||
browser.runtime.onMessage.addListener(function(data){
|
browser.runtime.onMessage.addListener(function(data){
|
||||||
if (data["canvasBlocker-set-domain-rnd"]){
|
if (data["canvasBlocker-set-domain-rnd"]){
|
||||||
@ -51,6 +52,9 @@
|
|||||||
}());
|
}());
|
||||||
scope.persistent = {
|
scope.persistent = {
|
||||||
name: "persistent",
|
name: "persistent",
|
||||||
|
setDomainRnd: function(domain, rnd){
|
||||||
|
persistentRnd[domain] = new Uint8Array(rnd);
|
||||||
|
},
|
||||||
getRng: function(length, window){
|
getRng: function(length, window){
|
||||||
var bitSet = getPersistentRnd(window);
|
var bitSet = getPersistentRnd(window);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user