1. 程式人生 > 實用技巧 >瀏覽器指紋修改之fonts字型指紋修改

瀏覽器指紋修改之fonts字型指紋修改

瀏覽器指紋修改之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;
    }
  });