Last active
September 27, 2021 16:51
-
-
Save legraphista/7498e518f623da1c20fed241d55e538d to your computer and use it in GitHub Desktop.
Electron 14 failing to open save dialog
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { app, BrowserWindow, dialog} = require('electron'); | |
app.on('ready', async () => { | |
const mainWindow = new BrowserWindow({ | |
center: true, | |
autoHideMenuBar: true, | |
webPreferences: { | |
nodeIntegration: true, | |
contextIsolation: false, | |
webSecurity: true, | |
}, | |
}); | |
await mainWindow.loadURL('about://blank') | |
dialog.showSaveDialogSync(mainWindow, { | |
title: 'Output location', | |
buttonLabel: 'Save & Start', | |
filters: [{ name: 'Video', extensions: ['mp4'] }], | |
properties: ['createDirectory', 'showOverwriteConfirmation'], | |
}); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment