{
  "api_version": "1.0.0",
  "slug": "rea-notion-clipboard-trace",
  "url": "https://reversedwithai.com/p/rea-notion-clipboard-trace",
  "markdown_url": "https://reversedwithai.com/p/rea-notion-clipboard-trace.md",
  "json_url": "https://reversedwithai.com/p/rea-notion-clipboard-trace.json",
  "title": "Traced how Notion Desktop's rich clipboard works through Electron IPC using REA",
  "tagline": "Following a Notion copy-paste from the preload bridge to the main process.",
  "summary": "An agent used REA's JavaScript analysis on Notion 7.6.1's packaged bundle to follow clipboard writes from the preload bridge through IPC to the main process, and how block structure survives copy and paste.",
  "target": {
    "name": "Notion Desktop 7.6.1",
    "type": "app",
    "type_label": "Apps"
  },
  "platform": "Electron",
  "models": [],
  "tools": [
    "REA"
  ],
  "outcome": "research",
  "outcome_label": "Research",
  "human_effort": null,
  "time_spent": null,
  "cost": null,
  "license": null,
  "checks": {
    "source_available": "yes",
    "repro_steps": null,
    "real_hardware": null,
    "independently_verified": null
  },
  "author": {
    "name": "REA project (morluto)",
    "url": "https://github.com/morluto/rea"
  },
  "sources": {
    "repository": null,
    "writeup": "https://rea.tools/showcase/notion/",
    "discussions": [],
    "all": [
      "https://rea.tools/showcase/notion/"
    ]
  },
  "image": {
    "url": "https://covers.reversedwithai.com/rea-notion-clipboard-trace.webp",
    "credit": "Image: rea.tools"
  },
  "commit_history": null,
  "added_at": "2026-10-14T00:00:48+00:00",
  "updated_at": "2026-10-14T00:00:48+00:00",
  "sources_reviewed_at": "2026-10-14T00:00:48+00:00",
  "reviewed_by": "editor",
  "human_notes": "The link between the exposed method and the main-process handler came from reading wrappers, not a fully automated trace; probes ran extracted modules rather than a live session.",
  "reproduce": null,
  "body_md": "An REA case study traces how Notion Desktop 7.6.1 copies text and HTML to the system clipboard. A coding agent used REA's JavaScript analysis on Notion's packaged Electron bundle to follow the call from the page-facing API through the preload bridge and IPC to Electron's clipboard writer in the main process.\n\n### How it was done\n\nThe example prompt asks the agent to use REA to trace how Notion copies text and HTML and to show the code at each step. REA's `analyze_javascript_application` result on the tab preload located the API exposed to the page (`__electronApi`) and an `ipcRenderer.invoke` call, with source ranges in the minified bundle. The agent opened those locations, found the clipboard member, and resolved the `invokerInMain` wrapper to the channel `notion:clipboard:write`. It then searched the main bundle for that channel and found the handler that checks the sender is a Notion web contents before calling `clipboard.write`.\n\n### Results\n\nThe trace covers four steps: page API, preload wrapper, main-process handler and system clipboard. A second finding explains how copied blocks keep their structure: the copied HTML carries a `notionvc` comment with an ID, and Notion stores the block data locally under that ID, restoring it on paste when the IDs match. The page also shows Notion's Markdown parser turning a table into rows and cells, and how offline SQLite work moves to a utility process over a message port. The case study says the link between the exposed method and the main-process handler came from reading wrapper code. The rich-copy and Markdown examples use web assets cached on 13 July 2026, with outputs from saved probes rather than a captured desktop session.\n\n### Status and how to try it\n\nThis is a published case study, not software to install. It traces Notion Desktop 7.6.1 from its app.asar using REA 4.1.0. The page reports four steps: the page-facing clipboard API, the preload wrapper, the main-process handler for the notion:clipboard:write channel, and Electron's clipboard.write.\n\nTo repeat it, install REA, obtain Notion Desktop 7.6.1's app.asar, run analyze_javascript_application on the tab preload and search the main bundle for the channel name. The page says the link between the exposed method and its handler came from reading wrapper code in the package, not from REA alone. The rich-copy and Markdown examples come from web assets cached on 13 July 2026, their outputs come from saved probes rather than a captured desktop session, and the copied text and ID shown are illustrative. The page gives no date for the desktop analysis.\n\nThe page does not name the AI model.\n\nSources:\n- https://rea.tools/showcase/notion/",
  "ai_use_excerpts": null
}
