electron/docs/fiddles/system/clipboard/paste/preload.js
2023-01-19 14:59:35 -05:00

6 lines
241 B
JavaScript

const { contextBridge, ipcRenderer } = require('electron')
contextBridge.exposeInMainWorld('clipboard', {
readText: () => ipcRenderer.invoke('clipboard:readText'),
writeText: (text) => ipcRenderer.invoke('clipboard:writeText', text)
})