mirror of https://github.com/gorhill/uBlock.git
Shield against possible case of invalid attribute name
Not sure this can really happen, but if ever Math.random() would return `0.9999999999999999`, the attribute name would start with `{`, i.e. an invalid attribute name.
This commit is contained in:
parent
5bea149e8f
commit
b1a338681b
|
@ -40,7 +40,7 @@ if (
|
||||||
|
|
||||||
vAPI.randomToken = function() {
|
vAPI.randomToken = function() {
|
||||||
const n = Math.random();
|
const n = Math.random();
|
||||||
return String.fromCharCode(n * 26 + 97) +
|
return String.fromCharCode(n * 25 + 97) +
|
||||||
Math.floor(
|
Math.floor(
|
||||||
(0.25 + n * 0.75) * Number.MAX_SAFE_INTEGER
|
(0.25 + n * 0.75) * Number.MAX_SAFE_INTEGER
|
||||||
).toString(36).slice(-8);
|
).toString(36).slice(-8);
|
||||||
|
|
Loading…
Reference in New Issue