electron/docs/fiddles/system/clipboard/paste/renderer.js

8 lines
280 B
JavaScript

const pasteBtn = document.getElementById('paste-to')
pasteBtn.addEventListener('click', async () => {
await clipboard.writeText('What a demo!')
const message = `Clipboard contents: ${await clipboard.readText()}`
document.getElementById('paste-from').innerHTML = message
})