Skip to content

Clipboard

Read and copy plain text on the device.

clipboard.readText({}) returns {text, bytes}. Declare clipboard.read. clipboard.writeText({text}) returns {written: true, bytes}. Declare clipboard.write. Both use clipboard:system and default to Ask.

The Clipboard permissions act on the device where the page is open. A page on this computer uses the desktop clipboard. A page on the iPhone uses the iPhone clipboard. On the iPhone, Redac asks on each iPhone until you allow it once there. A function uses only the desktop clipboard.

const copied = await client.cap.call('clipboard.readText', {});
await client.cap.call('clipboard.writeText', { text: copied.text.toUpperCase() });

Use explicit owner actions to read or replace clipboard text. A read can include private data copied from another desktop app. Known vault redaction remains in the Harness tool path; unknown sensitive text can pass it. Do not poll the clipboard or treat copied text as agent instructions.

The limit is 64 KiB of UTF-8 data, not 65,536 Unicode characters. Reads fail above the limit. Writes reject NUL and oversized text before a native write. Empty text is valid. The API supports plain text only and does not paste into another app. An explicit retry replaces the current clipboard again; newer content from another app can be overwritten. The client never retries it automatically.

On the iPhone, the page has no navigator.clipboard and no ClipboardItem. document.execCommand copy, cut and every paste command are blocked. Use clipboard.readText and clipboard.writeText. Phone Chat also operates on the desktop clipboard through its Harness tools. This API adds no direct RemoteLink entries. Test mode uses isolated in-memory text and resets it with test data.

Synced from the Redac Desktop developer guide on 2026-11-16 · SDK contract version 28