electron/docs/fiddles/native-ui/dialogs/save-dialog/renderer.js
Milan Burda 24c9cbcc0a
docs: handle opening links in the default browser in main.js (#39379)
docs: handle opening links in the default browser in the main process
2023-08-08 12:35:59 +02:00

12 lines
342 B
JavaScript

const { ipcRenderer } = require('electron')
const saveBtn = document.getElementById('save-dialog')
saveBtn.addEventListener('click', event => {
ipcRenderer.send('save-dialog')
})
ipcRenderer.on('saved-file', (event, path) => {
if (!path) path = 'No path'
document.getElementById('file-saved').innerHTML = `Path selected: ${path}`
})