Skip to content

Instantly share code, notes, and snippets.

@legraphista
Last active September 27, 2021 16:51
Show Gist options
  • Save legraphista/7498e518f623da1c20fed241d55e538d to your computer and use it in GitHub Desktop.
Save legraphista/7498e518f623da1c20fed241d55e538d to your computer and use it in GitHub Desktop.
Electron 14 failing to open save dialog
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