clipboard Type
⚠ Process Availability: Main ✔ | Renderer ✔ | Utility ❌ | Exported ✔
Perform copy and paste operations on the system clipboard.Process: Main, Renderer (non-sandboxed only)> [!IMPORTANT] If you want to call this API from a renderer process with context isolation enabled, place the API call in your preload script and expose it using the contextBridge API.On Linux, there is also a selection clipboard. To manipulate it you need to pass selection to each method:
Static members
| Static member |
Description
|
Full Usage:
clipboard.availableFormats ?type
Parameters:
Type
Returns: string[]
Modifiers: inline |
|
|
Clears the clipboard content.
|
Full Usage:
clipboard.has (format, ?type)
Parameters:
string
?type : Type
Returns: bool
Modifiers: inline |
|
Full Usage:
clipboard.read format
Parameters:
string
Returns: string
Modifiers: inline |
Reads format type from the clipboard.format should contain valid ASCII characters and have / separator. a/c, a/bc are valid formats while /abc, abc/, a/, /a, a are not valid.
|
|
⚠ OS Compatibility: WIN ✔ | MAC ✔ | LIN ❌ | MAS ❌
|
Full Usage:
clipboard.readBuffer format
Parameters:
string
Returns: Buffer
Modifiers: inline |
|
Full Usage:
clipboard.readFindText ()
Returns: string
Modifiers: inline |
⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌ The text on the find pasteboard, which is the pasteboard that holds information about the current state of the active application’s find panel.This method uses synchronous IPC when called from the renderer process. The cached value is reread from the find pasteboard whenever the application is activated.
|
|
|
Full Usage:
clipboard.readImage ?type
Parameters:
Type
Returns: NativeImage
Modifiers: inline |
|
|
|
|
|
|
|
Full Usage:
clipboard.writeBookmark (title, url, ?type)
Parameters:
string
url : string
?type : Type
Modifiers: inline |
⚠ OS Compatibility: WIN ✔ | MAC ✔ | LIN ❌ | MAS ❌ Writes the title (macOS only) and url into the clipboard as a bookmark.> [!NOTE] Most apps on Windows don't support pasting bookmarks into them so you can use clipboard.write to write both a bookmark and fallback text to the clipboard.
|
|
|
Full Usage:
clipboard.writeFindText text
Parameters:
string
Modifiers: inline |
⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌ Writes the text into the find pasteboard (the pasteboard that holds information about the current state of the active application’s find panel) as plain text. This method uses synchronous IPC when called from the renderer process.
|
Full Usage:
clipboard.writeHTML (markup, ?type)
Parameters:
string
?type : Type
Modifiers: inline |
Writes markup to the clipboard.
|
Full Usage:
clipboard.writeImage (image, ?type)
Parameters:
NativeImage
?type : Type
Modifiers: inline |
Writes image to the clipboard.
|
Full Usage:
clipboard.writeRTF (text, ?type)
Parameters:
string
?type : Type
Modifiers: inline |
Writes the text into the clipboard in RTF.
|
Full Usage:
clipboard.writeText (text, ?type)
Parameters:
string
?type : Type
Modifiers: inline |
Writes the text into the clipboard as plain text.
|
fable-electron-docs-api