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

8 lines
308 B
JavaScript
Raw Normal View History

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()
})