electron/docs/fiddles/system/clipboard/copy/preload.js

6 lines
181 B
JavaScript
Raw Normal View History

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