-
Notifications
You must be signed in to change notification settings - Fork 0
Remove programmatic fullscreen requests that violate browser security policies #79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -183,16 +183,47 @@ export function setupFullscreenToggle(element) { | |
| const success = await multiMonitorManager.spawnWindows(matrixConfig); | ||
|
|
||
| if (success) { | ||
| // Request fullscreen on all spawned windows | ||
| // Notify child windows (they must enter fullscreen manually via double-click) | ||
| await multiMonitorManager.requestFullscreenAll(); | ||
| console.log("Multi-monitor windows opened. Double-click each window to enter fullscreen."); | ||
|
|
||
| // Request fullscreen on main window | ||
| try { | ||
| const result = requestFullscreen(element); | ||
| if (result && result.catch) { | ||
| result.catch((error) => { | ||
| console.error("Fullscreen request failed:", error.message); | ||
| }); | ||
| } | ||
| } catch (error) { | ||
| console.error("Fullscreen request failed:", error.message); | ||
| } | ||
| } else { | ||
| // Fall back to single-screen fullscreen | ||
| console.warn("Multi-monitor fullscreen failed, falling back to single screen"); | ||
| requestFullscreen(element); | ||
| try { | ||
| const result = requestFullscreen(element); | ||
| if (result && result.catch) { | ||
| result.catch((error) => { | ||
| console.error("Fullscreen request failed:", error.message); | ||
| }); | ||
| } | ||
| } catch (error) { | ||
| console.error("Fullscreen request failed:", error.message); | ||
| } | ||
| } | ||
| } else { | ||
| // Normal single-screen fullscreen | ||
| requestFullscreen(element); | ||
| try { | ||
| const result = requestFullscreen(element); | ||
| if (result && result.catch) { | ||
| result.catch((error) => { | ||
| console.error("Fullscreen request failed:", error.message); | ||
| }); | ||
| } | ||
| } catch (error) { | ||
| console.error("Fullscreen request failed:", error.message); | ||
| } | ||
|
Comment on lines
+191
to
+226
|
||
| } | ||
| } else { | ||
| // In fullscreen, exit it | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This
requestFullscreenruns only afterawait multiMonitorManager.spawnWindows(...)earlier in the same double‑click handler. The updated docs inMULTI_MONITOR.mdexplicitly note that user gestures don’t survive async operations/promises, so the browser will reject this call (Permissions check failed) and the main window never enters fullscreen in multi‑monitor mode. Users then can’t fullscreen the main window without re-triggering the flow (which re-spawns windows). Consider issuing the fullscreen request before the awaited work or requiring a second, dedicated user gesture for the main window.Useful? React with 👍 / 👎.