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

The custom setPermissionCheckHandler only allowed media/audioCapture/
videoCapture, which made Electron deny the 'automatic-fullscreen'
permission consulted during HTML5 video requestFullscreen(). The
request handler's isMediaCapturePermission() also returned false for
'fullscreen'. Result: the native fullscreen button on <video controls>
in chat silently did nothing.

Allow 'fullscreen' + 'automatic-fullscreen' in both handlers.

Verified with a minimal Electron repro using Hermes' exact handlers:
requestFullscreen() failed with 'TypeError: Permissions check failed'
before; works after. User-verified in the packaged desktop app.
This commit is contained in:
Youssef
2026-08-10 01:07:30 +01:00
committed by brooklyn!
parent f36b6b0ce6
commit 360c1ee836

View File

@@ -7369,6 +7369,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
}
@@ -7431,6 +7438,7 @@ function installMediaPermissions() {
session.defaultSession.setPermissionCheckHandler((_webContents, permission) => {
return (
permission === 'media' ||
permission === 'automatic-fullscreen' ||
permission === ('audioCapture' as any) /* todo: is this needed? */ ||
permission === ('videoCapture' as any)
)