electron/docs/fiddles/media/screenshot/take-screenshot/renderer.js

7 lines
308 B
JavaScript

const screenshot = document.getElementById('screen-shot')
const screenshotMsg = document.getElementById('screenshot-path')
screenshot.addEventListener('click', async (event) => {
screenshotMsg.textContent = 'Gathering screens...'
screenshotMsg.textContent = await window.electronAPI.takeScreenshot()
})