diff --git a/electron/app.ts b/electron/app.ts index a6a76fa..75dd7ac 100644 --- a/electron/app.ts +++ b/electron/app.ts @@ -602,6 +602,14 @@ function setupApp() { mainWindow.focus(); } }); + app.on('web-contents-created', (e, webContents) => { + webContents.on('will-redirect', (e, url) => { + if (/^file:/.test(url)) { + console.warn('Prevented redirect to ' + url); + e.preventDefault(); + } + }); + }); app.on('certificate-error', (event, webContents, url, error, certificate, callback) => { if (process.env.NODE_ENV === 'dev') { // Verification logic.