diff options
author | Saúl Ibarra Corretgé <s@saghul.net> | 2023-05-22 10:26:33 +0200 |
---|---|---|
committer | Saúl Ibarra Corretgé <s@saghul.net> | 2023-05-22 10:52:25 +0200 |
commit | 9605c3dd0f932618f6eda19a467b9a7e0029e3d6 (patch) | |
tree | b00d773bab745e4d780f192935216bca623fba6e | |
parent | f98fc1093386b3629821617b390ae11317fae41f (diff) |
fix(main) block opening any external applications
-rw-r--r-- | main.js | 16 |
1 files changed, 14 insertions, 2 deletions
@@ -250,7 +250,7 @@ function createJitsiMeetWindow() { if (!requestedBasename.startsWith(appBasePath)) { callback(false); - console.log(`Rejected file URL: ${details.url}`); + console.warn(`Rejected file URL: ${details.url}`); return; } @@ -289,11 +289,23 @@ function createJitsiMeetWindow() { const requestedUrl = new URL.URL(url); if (!allowedRedirects.includes(requestedUrl.protocol)) { - console.log(`Disallowing redirect to ${url}`); + console.warn(`Disallowing redirect to ${url}`); ev.preventDefault(); } }); + // Block opening any external applications. + mainWindow.webContents.session.setPermissionRequestHandler((_, permission, callback, details) => { + if (permission === 'openExternal') { + console.warn(`Disallowing opening ${details.externalURL}`); + callback(false); + + return; + } + + callback(true); + }); + initPopupsConfigurationMain(mainWindow); setupAlwaysOnTopMain(mainWindow, null, windowOpenHandler); setupPowerMonitorMain(mainWindow); |