aboutsummaryrefslogtreecommitdiff
path: root/main.js
diff options
context:
space:
mode:
authorSaúl Ibarra Corretgé <s@saghul.net>2023-05-22 10:26:33 +0200
committerSaúl Ibarra Corretgé <s@saghul.net>2023-05-22 10:52:25 +0200
commit9605c3dd0f932618f6eda19a467b9a7e0029e3d6 (patch)
treeb00d773bab745e4d780f192935216bca623fba6e /main.js
parentf98fc1093386b3629821617b390ae11317fae41f (diff)
fix(main) block opening any external applications
Diffstat (limited to 'main.js')
-rw-r--r--main.js16
1 files changed, 14 insertions, 2 deletions
diff --git a/main.js b/main.js
index 4d71d8a..a2db555 100644
--- a/main.js
+++ b/main.js
@@ -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);