Skip to content

click on React-driven SPAs silently ignored (synthetic vs. trusted events) #37

@apireno

Description

@apireno

Symptom

`click` on a React-controlled element on LinkedIn, Twitter/X, Notion, and similar SPAs reports `✓ Clicked` but the page doesn't respond. URL stays put, no route change, no handler fires. Affects `

` fake-links and any element whose onClick is bound through React's synthetic event system.

Surfaced by an agent scraping LinkedIn messaging on 2026-05-25, trying to navigate from the inbox into individual threads. Three independent dispatch attempts (DOMShell `click`, inline `js .click()`, full `pointerdown`/`mousedown`/`mouseup`/`click` sequence) all failed silently.

Root cause

`handleClick` (src/background/index.ts:3049) tries `cdp.clickByBackendNodeId()` first, which calls `Element.prototype.click()` via `Runtime.callFunctionOn` (src/background/cdp_client.ts:103):

```typescript
functionDeclaration: `function() { this.click(); }`
```

That synthesizes a click event with `event.isTrusted = false`. Modern React-driven SPAs routinely guard against synthetic clicks — both in their own handlers and via React's reconciler — and silently ignore them.

`cdp.clickByCoordinates()` uses `Input.dispatchMouseEvent` which produces trusted browser-level events React respects, but it's only attempted as a fallback on exception (src/background/index.ts:3073). The element-method click rarely throws — it just no-ops semantically — so the trusted path never runs.

Fix (shipping in 1.3.1)

Swap the try-order: `clickByCoordinates` (trusted) first, `clickByBackendNodeId` (synthetic) as the fallback for nodes without a usable bounding box (hidden, zero-size, off-layout).

Reference

  • Agent diagnosis: "DOMShell click on the row reports '✓ Clicked' but location.href stays /messaging/?filter=unread. A js .click() on the inner link div — URL unchanged. js dispatching the full pointerdown→mousedown→mouseup→click sequence — URL unchanged."
  • Element profile: `
    ` (no `` / `href`, React-controlled).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions