Skip to Content
Platform Ontology

Real or scripted event flag

Every click and key event says whether the browser made it or a script made it.

Gets silentlyWhile you use it

Event.isTrusted is true for events created by the browser from real input and false for events a page script creates with dispatchEvent or element.click(). Agents that drive the browser through the DevTools Protocol send input the browser treats as real, so they pass. Agents that script clicks inside the page fail.

What it can and can't do

What the user does: Nothing. It is on every event

It can

  • Check the flag on click, key and pointer events
  • Ignore or flag untrusted events
  • Spot in page scripts that fake clicks
  • Combine with timing and movement data

It cannot

  • Catch agents that send real input through the DevTools Protocol
  • Tell a person from a remote controlled browser
  • See who wrote the script
  • Block browser extensions that act for you

How it differs between platforms: Tools that send input through the browser's own input path produce trusted events, so the flag only catches simple scripts.

Browser support

How a site asks for it

APIevent.isTrusted
Browser compat keysapi.Event.isTrusted
How access is grantednone
What the user seesNone
Needs a secure context (HTTPS)No
Needs a user gestureNo
How long it lastsNot listed
How to take it backNot listed
Inside an iframeNot listed

Typical flow

  1. Page listens for click, key and pointer events
  2. Handler reads event.isTrusted
  3. False values from user actions suggest scripts

Data you get

Shape: boolean
How often: per event

FieldTypeUnitRangePrecision
isTrustedbooleanNonetrue when the browser created the eventNot listed

Technical limits

  • Trusted for DevTools Protocol input
  • Some browser features require trusted events anyway
  • Only a hint for security

The story

What it is

The browser stamps each event as genuine or generated by a script, and the page can read the stamp.

For you

You never see it. Your own clicks are trusted. Browser extensions and macro tools that fake clicks in the page can be ignored by sites.

For makers

A false value is a strong sign of an in page script. A true value proves little, because DevTools Protocol input is trusted. Do not rely on it for security decisions alone.

Where you see it

TypeExampleApps
securityA bank page ignores untrusted clicks on the transfer button.None named
shoppingA checkout button refuses untrusted click events to stop in page bots.None named
adsAn ad unit only counts clicks whose event is trusted.None named
gamesA browser game drops untrusted key events from auto play scripts.None named
developerA tester finds that element.click() fails a site that wants real input.Playwright
accessibilityA site must still accept assistive tools that send trusted input.None named

Risks

  • Blocks some assistive tools
  • Bypassed by protocol level input

What the platform says

  • MDN: Event.isTrusted. Docs say the property is true when the event was generated by a user action.

Good uses and abuse

Legitimate uses

  • Click fraud defense
  • Bot defense

Known abuse

  • Blocking legitimate assistive or automation tools

Scores

ScoreValueMeaning
Sensitivity1 of 5How revealing the data is
Utility4 of 5How useful it is to honest apps
Friction0 of 5How much the user has to do
Fingerprint bits0.1Rough identifying entropy, when known

History

  • 2015-10, Chrome 46: Event.isTrusted ships in Chrome

Sources

How well checked: Based on official documentation.

On this page