From 5f9a74d45d1b695f010bfc5219c2e3635662cbbc Mon Sep 17 00:00:00 2001 From: Ujjwal Sharma Date: Sun, 14 Sep 2025 18:04:07 +0530 Subject: [PATCH] permissions: Allow fullscreen video requests on macOS On macOS, videos embedded in Zulip Desktop could not enter fullscreen mode because the app's permission handler did not explicitly grant fullscreen permissions. This commit updates the `ipcRenderer.on("permission-request")` handler to include fullscreen, in addition to existing permissions such as notifications. With this change, video players (e.g., YouTube and Zulip-embedded media) can properly request fullscreen. Tested on macOS to confirm fullscreen now works, and on Windows/Linux to ensure no regressions. Fixes #1409. --- app/renderer/js/main.ts | 30 ++++++++++++++++-------------- package-lock.json | 6 +++--- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/app/renderer/js/main.ts b/app/renderer/js/main.ts index 6fb029e34..b20342ea3 100644 --- a/app/renderer/js/main.ts +++ b/app/renderer/js/main.ts @@ -961,20 +961,22 @@ export class ServerManagerView { permissionCallbackId: number, ) => { const grant = - webContentsId === null - ? origin === "null" && permission === "notifications" - : ( - await Promise.all( - this.tabs.map(async (tab) => { - if (!(tab instanceof ServerTab)) return false; - const webview = await tab.webview; - return ( - webview.webContentsId === webContentsId && - webview.properties.hasPermission?.(origin, permission) - ); - }), - ) - ).some(Boolean); + permission === "fullscreen" + ? true + : webContentsId === null + ? origin === "null" && permission === "notifications" + : ( + await Promise.all( + this.tabs.map(async (tab) => { + if (!(tab instanceof ServerTab)) return false; + const webview = await tab.webview; + return ( + webview.webContentsId === webContentsId && + webview.properties.hasPermission?.(origin, permission) + ); + }), + ) + ).some(Boolean); console.log( grant ? "Granted" : "Denied", "permissions request for", diff --git a/package-lock.json b/package-lock.json index 0c5a9dcb6..7f6a41449 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15134,9 +15134,9 @@ } }, "node_modules/vite": { - "version": "5.4.19", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.19.tgz", - "integrity": "sha512-qO3aKv3HoQC8QKiNSTuUM1l9o/XX3+c+VTgLHbJWHZGeTPVAg2XwazI9UWzoxjIJCGCV2zU60uqMzjeLZuULqA==", + "version": "5.4.20", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.20.tgz", + "integrity": "sha512-j3lYzGC3P+B5Yfy/pfKNgVEg4+UtcIJcVRt2cDjIOmhLourAqPqf8P7acgxeiSgUB7E3p2P8/3gNIgDLpwzs4g==", "dev": true, "license": "MIT", "dependencies": {