Защита от Font Fingerprint

Мне известен следующий способ блокировки снятия font fingerprint браузера.

var rand = {
    "noise": function () {
      var SIGN = Math.random() < Math.random() ? -1 : 1;
      return Math.floor(Math.random() + SIGN * Math.random());
    },
    "sign": function () {
      const tmp = [-1, -1, -1, -1, -1, -1, +1, -1, -1, -1];
      const index = Math.floor(Math.random() * tmp.length);
      return tmp[index];
    }
  };
  //
  Object.defineProperty(HTMLElement.prototype, "offsetHeight", {
    get () {
      const height = Math.floor(this.getBoundingClientRect().height);
      const valid = height && rand.sign() === 1;
      const result = valid ? height + rand.noise() : height;
      return result;
    }
  });
  //
  Object.defineProperty(HTMLElement.prototype, "offsetWidth", {
    get () {
      const width = Math.floor(this.getBoundingClientRect().width);
      const valid = width && rand.sign() === 1;
      const result = valid ? width + rand.noise() : width;
      return result;
    }
});

Проблема в том, что многие антифрод-системы прекрасно понимают, что шрифты выдаются просто произвольные. Для этого достаточно дважды провести снятие отпечатков и сверить результаты. Подскажите, как можно модифицировать скрипт, чтобы в контексте текущей сессии отпечаток не менялся?


Ответы (0 шт):