Skip to content

Contenteditable typing fails on Reddit/Shreddit (Lexical editor) #1

@xidik12

Description

@xidik12

Problem

Oculo cannot type into Reddit's new editor (Shreddit, built on Lexical). All 5 strategies fail:

  1. CDP Input.dispatchKeyEvent — debugger attaches to renderer webContents, not the webview guest
  2. InputEvent dispatchisTrusted: false, Lexical rejects
  3. insertText (Electron IME) — Lexical ignores IME events
  4. execCommand('insertText') — Lexical doesn't use execCommand
  5. sendInputEvent char-by-char — Electron events not reaching Lexical's event listeners

Root Cause

Reddit's Lexical editor validates event.isTrusted and rejects all programmatic input. The CDP approach (which generates trusted events) fails because the debugger attaches to the wrong webContents — it needs to attach to the <webview> tag's guest webContents, not the renderer's.

Fix Required

  1. In the IPC handler for view:cdp-type, get the webview's guest webContents ID (not the renderer's)
  2. The renderer should pass the webview's getWebContentsId() value, not the BrowserView/WebContentsView ID
  3. Route debugger.attach() to the guest webContents

Affected Sites

  • Reddit (new.reddit.com) — Shreddit/Lexical editor
  • Any site using Lexical, ProseMirror, or editors that check isTrusted
  • Twitter/X works fine (uses standard contenteditable without isTrusted checks)

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