浏览器指纹修改之fonts字体指纹修改,附上完整浏览器指纹在线查看:http://www.sdfymj.com/ua.php
代码如下:
var rand3 = { "noise": function () {
var SIGN = Math.random() < Math.random() ? -1 : 1;
var SIGN = num1 < num2 ? -1 : 1;
return Math.floor(num1 + SIGN * num2);
},
"sign": function () {
const tmp = [-1, -1, -1, -1, -1, -1, +1, -1, -1, -1];
const index = Math.floor(num * tmp.length);
return tmp[index];
}
};
Object.defineProperty(HTMLElement.prototype, "offsetHeight", {
get () {
const height = Math.floor(this.getBoundingClientRect().height);
const valid = height && rand3.sign() === 1;
const result = valid ? height + rand3.noise() : height;
return result;
}
});
Object.defineProperty(HTMLElement.prototype, "offsetWidth", {
get () {
const width = Math.floor(this.getBoundingClientRect().width);
const valid = width && rand3.sign() === 1;
const result = valid ? width + rand3.noise() : width;
return result;
}
});