From e9e4d1f32521ffd626942fa3e345dd3859d1ade6 Mon Sep 17 00:00:00 2001 From: Sam Grund Date: Thu, 14 Jan 2021 13:00:03 -0500 Subject: [PATCH] fix: (hopefully) only allow CSV downloads on windows --- main.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/main.js b/main.js index babcfd86..8cb3189d 100644 --- a/main.js +++ b/main.js @@ -28,6 +28,16 @@ try { // use server for route mainWindow.loadURL(`http://localhost:${env.PORT}`) + + mainWindow.webContents.session.on( + 'will-download', + (event, downloadItem, webContents) => { + downloadItem.setSaveDialogOptions({ + filters: [{ name: 'CSV', extensions: ['csv'] }], + message: 'Download CSV', + }) + } + ) } app.on('ready', createWindow)