# What is prototype tampering detection?

> Prototype tampering detection checks browser APIs for signs a script replaced them: wrong names, extra properties, non-native source, Proxy errors.

Source: https://mosaicbrowser.com/glossary/prototype-tampering-detection

## Prototype tampering detection: catching a faked browser API

Prototype tampering detection is a set of page checks that find browser functions and properties a script has replaced, such as a rewritten navigator.userAgent getter or a wrapped WebGL call. It compares each one's name, descriptor, source text and error behaviour with what the real browser's built-in version produces.

![28 rewritten accessors, every one anonymous, drawn as a mosaic of tiles](https://mosaicbrowser.com/covers/prototype-tampering-detection.webp)

Every browser API a page can call has a fixed shape. `navigator.userAgent` is a getter on `Navigator.prototype`, named `get userAgent`, taking no arguments, and its source prints as native code. A fingerprint spoof written in JavaScript has to replace that getter with its own, and the replacement is a different object. Prototype tampering detection is the search for that difference, one property at a time.

## What prototype tampering detection compares

CreepJS, the open-source fingerprinting test by Abraham Juliot, has a page that runs these checks over the prototypes a fingerprint reads ([prototype test](https://abrahamjuliot.github.io/creepjs/tests/prototype.html), read 2 November 2026). Its test script names each failure it can report, and the names are a good map of the field:

- `failed toString`: the function's source text is not what a built-in prints.
- `failed descriptor` and `failed descriptor keys`: the property's descriptor, or its set of keys, is not the native one.
- `failed own property` and `failed own property names`: a property sits on an object where the real browser has none, for example `webdriver` defined on `navigator` itself instead of on its prototype.
- `failed new instance error`, `failed class extends error`, `failed call interface error`: the function answers `new`, `extends` or a wrong `this` differently from the built-in, which usually throws a specific error.
- `failed at incompatible proxy error` and `failed at chain cycle error`: edge cases where a JavaScript Proxy behaves differently from the object it wraps.

None of these reads the spoofed value. A profile that claims exactly the right GPU still fails if the function that reports it was swapped.

Mosaic is a desktop app

Email yourself the link and open it on your computer.

[How it works: Leak tests and detectors](https://mosaicbrowser.com/features/detection-tests)

## Why Proxy wrapping is not enough

The usual answer is to wrap each real function in a JavaScript `Proxy`, which forwards calls to the original and prints as native code. It passes the simple tests and fails the strange ones: recursion through `__proto__`, a prototype chain that would loop, a `Reflect.setPrototypeOf` on the wrapper. CreepJS keeps a [second page](https://abrahamjuliot.github.io/creepjs/tests/proxy.html) aimed only at Proxy-wrapped built-ins. Iframes and workers add one more test, because a wrapper installed in the page has to be installed again in every new context, and a fresh iframe's untouched copy is a reference to compare against.

## What it found in our own code

Before we moved fingerprint values into the engine, our spoofs were JavaScript too. A diff against an untouched Chrome checked three levels: names, descriptors and values. The descriptor level found that all 28 of our accessors were anonymous. In Chrome, `Object.getOwnPropertyDescriptor(Navigator.prototype, 'userAgent').get.name` is `"get userAgent"`; ours was an empty string. A page could list every override we had in one loop, without calling `toString` once. Our `markNative` helper had fixed how the functions printed and nothing else. The same diff found a hidden global we had named `__mosaic__`, invisible to `Object.keys` and listed by `Object.getOwnPropertyNames(window)`. [JavaScript spoofing detection](https://mosaicbrowser.com/glossary/javascript-spoofing-detection) covers the other ways a script-level spoof shows.

## How Mosaic handles it

On Tesseract Chrome no built-in is replaced from JavaScript. Fingerprint values are changed inside the engine, so `navigator.userAgent` is the browser's own getter returning the profile's value, with Chrome's name, descriptor and source, in every frame and worker. Mosaic's [Detection tests](https://mosaicbrowser.com/features/detection-tests) include both CreepJS pages, prototype tampering and proxy detection, in the Automation group, so you can run them in a profile's own browser and read which property, if any, they name. [The CreepJS trust score](https://mosaicbrowser.com/guides/creepjs-trust-score-explained) explains how the main CreepJS page reports what these tests find.

## Sources

1. [CreepJS: prototype test page](https://abrahamjuliot.github.io/creepjs/tests/prototype.html), read November 2, 2026
2. [CreepJS: proxy test page](https://abrahamjuliot.github.io/creepjs/tests/proxy.html), read November 2, 2026
3. [CreepJS on GitHub](https://github.com/abrahamjuliot/creepjs), read November 2, 2026

## Questions

### Can Function.prototype.toString be faked?

The text can be, and many spoof scripts make a rewritten function print [native code]. That only fixes one test. The function's name, length, descriptor and the errors it throws are separate checks, and toString itself can be inspected the same way.

### Why do spoof scripts use a JavaScript Proxy?

Because a Proxy around a real built-in function inherits much of its shape, including how it prints. It still behaves differently in edge cases, so CreepJS keeps a separate test page just for Proxy-wrapped natives.

### Does prototype tampering detection catch browser extensions?

It catches any script that rewrites built-in APIs in the page, and extensions that spoof fingerprints are one such script. Extensions that only read the page or add their own elements leave the built-ins alone.

### Can a site see which property was tampered with?

Yes. A check walks named prototypes and properties, so a finding names the exact one, for example the userAgent getter on Navigator.prototype. That is also what makes the test useful to the person fixing a spoof.

## Related

[JavaScript spoofing detection: how a page finds a rewritten value](https://mosaicbrowser.com/glossary/javascript-spoofing-detection): JavaScript spoofing detection is a page proving a fingerprint value was rewritten by script: from the override's own traces, or from a context it missed.

[navigator.webdriver: the flag that says automation is driving](https://mosaicbrowser.com/glossary/navigator-webdriver): navigator.webdriver is a browser property that reads true when automation controls the browser. Chrome sets it for --enable-automation and --headless.

[CreepJS trust score explained, and what to read now it is gone](https://mosaicbrowser.com/guides/creepjs-trust-score-explained): The live CreepJS build showed no trust score on our 19 September 2026 run, for stock Chrome either. Read lies, headless, stealth and its worker test instead.

[How do sites detect anti-detect browsers?](https://mosaicbrowser.com/guides/how-do-sites-detect-anti-detect-browsers): Sites detect anti-detect browsers by contradictions: a page and its workers disagreeing, a GPU name the driver does not match, fonts from another OS.

[Detection tests: check a profile against 49 public detectors](https://mosaicbrowser.com/features/detection-tests): Test your anti-detect browser against detectors: Mosaic lists 49 public ones in five groups, from Pixelscan to a reCAPTCHA v3 score, and opens any in a profile.





[Headless browser detection: how sites spot a browser with no screen](https://mosaicbrowser.com/glossary/headless-browser-detection): Headless browser detection is how a site tells a browser with no window, usually under automation, from one a person uses. Here is what it reads.

## See prototype tampering detection on a real profile

Mosaic shows the values a site reads, per profile, and runs a leak test from inside the profile’s own page. Free covers 3 profiles with no card, and Pro is $25 a month for any number of them.

Mosaic is a desktop app

Email yourself the link and open it on your computer.
