feat(desktop): window.open popout Detach for Firefox #87
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/VAPP-75-firefox-window-open-detach"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Browsers without Document Picture-in-Picture (Firefox today) had a disabled Detach button with a "Firefox does not support it yet" tooltip, so Detach was dead there. This adds the non-PiP popout path VAPP-50 promised: when
pip_supported()is false the toolbar now renders a single enabled Detach/Re-dock toggle that opens a same-originwindow.openpopup sized to the remote framebuffer and reparents the live canvas node into it. The popup shares this page's JS/wasm realm, so the WebSocket transport, 2D context, and input listeners travel with the node and the session keeps streaming with no reconnect. Chromium keeps the existing Document PiP path unchanged.The PiP reparent/re-dock body is factored into
move_canvas_into_window, shared by both paths via apoll_closedflag. Popups do not reliably deliverpagehideto the opener, so the popout path also pollswindow.closed(a 250ms interval that re-docks and self-cancels once closed); a shared one-shot latch runs the re-dock exactly once whichever trigger fires first.PipSessiongains an optionalPopoutPolland aclosemethod so teardown removes the pagehide listener, cancels the poll interval, and closes the window, leaking no window, WebSocket, listener, or timer. The chosen live-canvas-reparent strategy (over a fresh popup session) is recorded in thedetach_windowdoc comment.The VAPP-70 source guard is extended to fail the build if the disabled-Detach tooltip returns or the
window.openpopout call disappears.#VAPP-75