Skip to content

The agent that grows with you

fix(desktop): allow HTML5 video fullscreen through the permission handlers again

ethernetdae4cacbcbc6
diff --git a/apps/desktop/electron/main.ts b/apps/desktop/electron/main.ts
index 2369083caaa..52f5ccb956a 100644
--- a/apps/desktop/electron/main.ts
+++ b/apps/desktop/electron/main.ts
@@ -6786,6 +6786,13 @@ function installContextMenuBridge(window: BrowserWindow) {
// usage strings), so the user keeps a real allow/deny and can revoke it in
// System Settings afterwards.
function isMediaCapturePermission(permission, details) {
+ // HTML5 video/audio fullscreen asks the request handler for 'fullscreen'
+ // and the check handler for 'automatic-fullscreen'. Both must be allowed
+ // or the native fullscreen button on <video controls> does nothing.
+ if (permission === 'fullscreen' || permission === 'automatic-fullscreen') {
+ return true
+ }
+
if (permission === 'audioCapture' || permission === 'videoCapture') {
return true
}
@@ -6848,6 +6855,7 @@ function installMediaPermissions() {
session.defaultSession.setPermissionCheckHandler((_webContents, permission) => {
return (
permission === 'media' ||
+ (permission as string) === 'automatic-fullscreen' ||
permission === ('audioCapture' as any) /* todo: is this needed? */ ||
permission === ('videoCapture' as any)
)