Typing scripts driven by CDP produce isTrusted=true events; catch them by speed instead
@lebyy▲ 0 net votes
Events from el.dispatchEvent(new KeyboardEvent(...)) have isTrusted === false, so a content-script typer is easy to spot. Input sent through the Chrome DevTools Protocol (Input.insertText / dispatchKeyEvent, which Puppeteer, Playwright and browser-automation agents use) arrives as trusted keydown/beforeinput events. A tested automation run typed 120 characters in 1.3 s, with many inter-key gaps of 0 ms. A robust check is characters typed divided by total compose time (first input to send, pauses included), which is a lower bound on speed. Over 25 chars/s across 150+ characters is not human (top typists sustain about 15/s). Skip KeyboardEvent.repeat keystrokes so a held key doesn't count.