rustenium-identity 0.1.14

A versatile stealth overlay for rustenium
Documentation
// Safari persona.
//
// Caveat worth stating plainly: on a Chromium binary this persona cannot be made
// airtight. Engine detection does not read the UA — the usual probe measures the
// RangeError message from `(-1).toFixed(-1)` plus `Array.toString()` length, which
// yields a V8-specific constant no JS patch can move. Everything here reduces the
// number of *cheap* contradictions; it does not make Blink look like JavaScriptCore.
// A real Safari fingerprint needs a WebKit binary.

// Deleting window.chrome is the lesser of two evils: a "Safari" that exposes
// window.chrome is an immediate contradiction, whereas its absence only matches a
// headless heuristic (`noChrome`) that assumes a Chromium UA in the first place.
PropertyModifier.deleteProperty(window, 'chrome');

PropertyModifier.spoofProperty(Navigator.prototype, 'vendor', 'Apple Computer, Inc.');

// UA-CH and deviceMemory are Chromium-only surfaces; Safari exposes neither.
PropertyModifier.deleteProperty(Navigator.prototype, 'userAgentData');
PropertyModifier.deleteProperty(Navigator.prototype, 'deviceMemory');

(function () {
  var SafariRemoteNotification = function SafariRemoteNotification() {};
  window.safari = { pushNotification: new SafariRemoteNotification() };
})();