Skip to main content
Access BrowserClipboard from the browser context. Clipboard operations target the active page unless you provide another page.

Quick start

readText()

Read plain text from the browser clipboard.
ClipboardOptions
Options that select a target page and configure the operation.
Page
The page to target. Defaults to the active page.
Promise<string>
The clipboard text.

writeText()

Write plain text to the browser clipboard.
string
The plain text to write.
ClipboardOptions
Options that select a target page and configure the operation.
Page
The page to target. Defaults to the active page.
Promise<void>
Resolves after the clipboard operation completes.

clear()

Clear the browser clipboard.
ClipboardOptions
Options that select a target page and configure the operation.
Page
The page to target. Defaults to the active page.
Promise<void>
Resolves after the clipboard operation completes.

paste()

Paste the clipboard contents into the active element.
ClipboardPasteOptions
Options that select a target page and configure the operation.
Page
The page to target. Defaults to the active page.
'ControlOrMeta+V' | 'Meta+V' | 'Control+V'
The keyboard shortcut to dispatch.
Promise<void>
Resolves after the clipboard operation completes.

copy()

Copy the current selection to the browser clipboard.
ClipboardOptions
Options that select a target page and configure the operation.
Page
The page to target. Defaults to the active page.
Promise<void>
Resolves after the clipboard operation completes.

cut()

Cut the current selection to the browser clipboard.
ClipboardOptions
Options that select a target page and configure the operation.
Page
The page to target. Defaults to the active page.
Promise<void>
Resolves after the clipboard operation completes.