diff options
author | Saúl Ibarra Corretgé <s@saghul.net> | 2023-05-09 13:14:34 +0200 |
---|---|---|
committer | Saúl Ibarra Corretgé <s@saghul.net> | 2023-05-09 15:18:42 +0200 |
commit | 2202530dfcc40f8ff793baf0c16e7615f03203fb (patch) | |
tree | 18cdf208474caeed3a327850544c1986e0720b3f | |
parent | df4bd258d2aac19945edb5c3ea1daee281d73bce (diff) |
fix(main) filter redirect protocols
-rw-r--r-- | main.js | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -250,6 +250,7 @@ function createJitsiMeetWindow() { if (!requestedBasename.startsWith(appBasePath)) { callback(false); + console.log(`Rejected file URL: ${details.url}`); return; } @@ -276,6 +277,23 @@ function createJitsiMeetWindow() { }); }); + // Block redirects. + const allowedRedirects = [ + 'http:', + 'https:', + 'ws:', + 'wss:' + ]; + + mainWindow.webContents.addListener('will-redirect', (ev, url) => { + const requestedUrl = new URL.URL(url); + + if (!allowedRedirects.includes(requestedUrl.protocol)) { + console.log(`Disallowing redirect to ${url}`); + ev.preventDefault(); + } + }); + initPopupsConfigurationMain(mainWindow); setupAlwaysOnTopMain(mainWindow, null, windowOpenHandler); setupPowerMonitorMain(mainWindow); |