1
0
Fork 0
mirror of https://github.com/kkapsner/CanvasBlocker synced 2025-07-03 20:16:33 +02:00

Simplified require and further linting.

This commit is contained in:
kkapsner 2017-10-06 16:06:31 +02:00
parent 01c1145e28
commit dcb878392e
15 changed files with 86 additions and 78 deletions

View file

@ -44,7 +44,9 @@
// create the (sub-)domains random numbers if not existing
persistentRnd[domain] = new Uint8Array(128);
window.crypto.getRandomValues(persistentRnd[domain]);
browser.runtime.sendMessage({"canvasBlocker-new-domain-rnd": {domain, rnd: Array.from(persistentRnd[domain])}});
browser.runtime.sendMessage({
"canvasBlocker-new-domain-rnd": {domain, rnd: Array.from(persistentRnd[domain])}
});
}
return persistentRnd[domain];
};
@ -75,7 +77,7 @@
},
getPixelRng: function(length, window, ignoredColors){
var rng = this.getRng(length, window);
return function(r, g, b, a, i){
return function(r, g, b, a, i){ // eslint-disable-line max-params
var index = String.fromCharCode(r, g, b, a);
if (ignoredColors[index]){
return [r, g, b, a];
@ -101,7 +103,7 @@
return function getConstantPixelRng(length, window, ignoredColors){
var rng = scope.nonPersistent.getRng(1024, window);
return function(r, g, b, a, i){
return function(r, g, b, a, i){ // eslint-disable-line max-params
var index = String.fromCharCode(r, g, b, a);
if (ignoredColors[index]){
return [r, g, b, a];
@ -147,7 +149,7 @@
},
getPixelRng: function(length, window, ignoredColors){
var rng = this.getRng(length, window);
return function(r, g, b, a, i){
return function(r, g, b, a, i){ // eslint-disable-line max-params
var index = String.fromCharCode(r, g, b, a);
if (ignoredColors[index]){
return [r, g, b, a];