Skip to content

feat: open owned child windows from the host - #25

Open
moonolgerd wants to merge 1 commit into
mainfrom
issue-19-child-windows
Open

moonolgerd wants to merge 1 commit into
mainfrom
issue-19-child-windows

Conversation

@moonolgerd

Copy link
Copy Markdown
Owner

Summary

  • window.open is handled with a WebView2 NewWindowRequested deferral, so the return value and window.opener are the owned child. window.openChild({ url, width, height }) opens a window owned by the caller at the requested outer size.
  • Same-origin only. A cross-origin URL is refused and returned to the page as { error }. The child connects to FDC3 as a new instance of the parent's appId and closes when the owner closes.
  • OpenChildRequest and window.openChild were added to the IPC contract. The TypeScript types were regenerated by Bermuda.IpcContract.SourceGenerator.

Test plan

  • dotnet test IpcDispatchTests: 12 passed
  • Biome lint on the edited TypeScript: clean
  • Playwright host-api child windows: 4 passed
  • Leftover: a page opened with window.open can call window.close(), but chrome.webview.hostObjects calls from that page never reach the host. openChild windows do not have that problem. Hiding the main window to the tray does not close owned children; they close when the owner actually closes.

Closes #19

Made with Cursor

window.open and window.openChild stay on the caller's origin, connect as a new FDC3 instance of the parent's app, and close with the window that owns them.

Co-authored-by: Cursor <cursoragent@cursor.com>
Copilot AI balanced review requested due to automatic review settings November 17, 2026 03:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Child windows

2 participants