How Notion copies text and HTML
Copy in the desktop app looks like one method on the page. It is four hops. The preload exposes clipboard.write, a wrapper calls ipcRenderer.invoke, the main process registers ipcMain.handle on the same channel, and Electron writes the text and HTML. The channel both sides share is notion:clipboard:write. The figure above is that bridge. Nothing here is a Notion product guide; it is a static reading of a package you are allowed to inspect.
Where a copy goes
The page calls clipboard.write. In the tab preload that method is a wrapper. The useful question is which channel the wrapper sends, and which function receives it.
Use REA to trace how Notion copies text and HTML to the system clipboard. Show the code at each step.
Analyzing the tab preload with REA locates the API exposed to the page and the IPC invoke. Both come back with source ranges in the minified bundle. Positions are line and zero-based column in that bundle, recorded with REA 4.1.0 on Notion Desktop 7.6.1’s app.asar.
Exposed page API
api_key: "__electronApi"
api_status: "dynamic"
source: preload.js:1:22764–22828
Renderer IPC call
operation: "invoke"
channel_expression: "e"
source: preload.js:1:6486–6522
Open those ranges, find the clipboard member inside the assembled API, and read invokerInMain. Its call site passes notion:clipboard:write. That string is what to search for in main/index.js.
Four short pieces of code
The excerpts below are simplified from the packaged JavaScript: variable names expanded, unrelated members omitted. They are a reading of the package, not a formatted source drop.
1. The API the page sees
const clipboardApi = {
write: invokerInMain("notion:clipboard:write")
};
// Included in the API exposed through contextBridge:
// window.__electronApi.clipboard
This member is the channel name. invokerInMain is how the request leaves the renderer.
2. The preload wrapper
function invokerInMain(channel) {
return (...args) => invokeInMainAndReturnResult(channel, ...args);
}
function invokeInMainAndReturnResult(channel, ...args) {
return ipcRenderer.invoke(channel, ...args);
}
The returned function forwards every argument through Electron’s request-and-response IPC. The main process can now be searched for the same channel string.
3. How the receiver is registered
const handleRequestFromRenderer = {
addListener(channel, handler) {
ipcMain.handle(channel, handler);
}
};
The main process hides ipcMain.handle behind addListener. Finding the wrapper matters: a search that only looks for ipcMain.handle("notion:clipboard:write" can miss the registration.
4. The write and the sender check
handleRequestFromRenderer.addListener(
"notion:clipboard:write",
(event, data) =>
isNotionWebContents(event.sender)
? clipboard.write(data)
: undefined
);
This is the destination. isNotionWebContents(event.sender) refuses the write when the sender is not a Notion web contents. When the check passes, clipboard.write(data) receives the text and HTML the page supplied. The channel plus the two wrappers are the whole bridge.
How a copied block keeps its structure
The web editor sends text and HTML through electronApi.clipboard.write. Block structure does not live in the system clipboard as a private format the OS understands. It stays in a local store, and the HTML carries an id that points back at that store.
Sent to the system clipboard
text: "Project notes"
html: "<p>Project notes</p>"
+ "<!-- notionvc: <copy-id> -->"
Saved locally
id: <copy-id>
mimeTypes:
text/_notion-blocks-v3-production
→ structured block data
On paste, the editor reads the HTML comment, looks up the same id locally, and restores block data when the ids match. A stale entry returns only the plain text and HTML. The id in the snippet is illustrative. The shape was recorded from web assets cached on 13 July 2026, including modules 747001, 58169, 736810, and 422457. Those assets have their own version, separate from desktop 7.6.1. Saved probes executed extracted modules and small harnesses; they describe those probes, not a captured click-through of the desktop UI.
A second example: Markdown tables
The same block model shows up when Markdown is parsed. Module 422457 turns a table into a header row plus data rows. Saved module tests show that both the page filter and the chat filter keep this table. Paste/import, structured Markdown, and AI/chat parsers have separate entry points and intermediate formats, so a trace of one parser does not automatically describe the others.
Markdown input
| A | B |
| - | - |
| 1 | 2 |
Structured parser output
table · headerRow: true
table_row
cells: ["A"], ["B"]
table_row
cells: ["1"], ["2"]
A side path: offline SQLite
Copy is not the only IPC handoff worth naming. The renderer requests getSqliteMeta. The main process creates a message channel, gives one port to the renderer, and the other to a SQLite utility process. Later statement batches and results travel on that port. Following only the first IPC request misses the rest of the conversation. Knowing which process owns the database work is the point of the inventory.
How to read this page
The clipboard bridge is from Notion Desktop 7.6.1’s app.asar: tab preload and main/index.js. REA’s focused preload analysis locates the exposed API and the invoke. Connecting the clipboard member to the receiver is then ordinary reading of those two wrappers. Use it as a map of process boundaries the next time you open an Electron package you are authorized to study — including the shorter process map linked under related cases.
Next step
Similar browser session records can become AgentEnv replay environments
This case is not a claim that it is a specific Hugging Face environment. When REA records an authorized browser session, Scale AgentEnv can expose replay as MCP tools. rea.run mirrors the catalog only — we do not host the RL runtime.
Environments catalog → What is AgentEnv + REA? HF collection ↗ Introducing AgentEnv
Compliance
Inspect a desktop package you are authorized to study: your own license, a corporate device policy that allows it, or another explicit permission. This page is a static IPC inventory. It is not a guide to scraping someone else’s workspace or bypassing account controls.
Takeaways
- One channel, notion:clipboard:write, joins preload and main.
- The sender check sits in front of clipboard.write.
- Block structure rides an HTML comment id, not a secret clipboard format.
- Static reading of an authorized package. Not a vault export.
Related on rea.run
More on-site cases