cmux/Sources/Panels
Manfred Neustifter 6b138f7d9d
feat: support window.open() popup windows (#1150)
* feat: support window.open() popup windows (#742)

Return a live WKWebView from createWebViewWith using WebKit's supplied
configuration, preserving popup browsing-context semantics (window.opener,
postMessage). This fixes OAuth/OIDC flows and any site relying on standard
popup patterns.

- Add BrowserPopupWindowController: NSPanel-based popup with self-retention,
  KVO title/URL, read-only URL label, nested popup depth limit (3),
  insecure-HTTP prompt parity, auth challenge parity, download delegate
- Classifier: scripted requests (window.open) create popups; user-initiated
  actions (Cmd+click, middle-click, context menu) open tabs
- Retarget context menu "Open Link in New Tab" to bypass createWebViewWith,
  wired in both main browser and popup web views
- Cmd+W fast path in AppDelegate for popup windows
- Opener panel owns popup lifecycle; close() tears down all child popups

* fix: Cmd+W closes only the popup, not the parent tab

Add BrowserPopupPanel (NSPanel subclass) that intercepts Cmd+W in
performKeyEquivalent before the swizzled cmux_performKeyEquivalent
can dispatch it to the main menu's "Close Tab" action.

Also refine the popup classifier to reuse browserNavigationShouldOpenInNewTab
for Cmd+click/middle-click detection, add download delegate wiring, and
wire onContextMenuOpenLinkInNewTab for popup web views.

* fix: tighten popup routing and window behavior

* test: cover oversized popup frame clamping

* test: cover plain link-activated popup routing

---------

Co-authored-by: Lawrence Chen <lawrencecchen@users.noreply.github.com>
2026-03-15 17:48:05 -07:00
..
BrowserPanel.swift feat: support window.open() popup windows (#1150) 2026-03-15 17:48:05 -07:00
BrowserPanelView.swift Hide unsafe side dock controls for attached devtools 2026-03-11 23:04:28 -07:00
BrowserPopupWindowController.swift feat: support window.open() popup windows (#1150) 2026-03-15 17:48:05 -07:00
CmuxWebView.swift feat: support window.open() popup windows (#1150) 2026-03-15 17:48:05 -07:00
MarkdownPanel.swift Add settings to disable pane ring and flash (#1217) 2026-03-13 03:52:56 -07:00
MarkdownPanelView.swift Make missing markdown path selectable (#1042) 2026-03-07 02:15:55 -08:00
Panel.swift Add browser find focus debug logs (#1162) 2026-03-10 19:31:52 -07:00
PanelContentView.swift Fix browser pane portal anchor sizing (#1094) 2026-03-09 13:28:05 -07:00
TerminalPanel.swift Merge origin/main into feat-cmux-themes-command 2026-03-13 17:22:12 -07:00
TerminalPanelView.swift Add settings to disable pane ring and flash (#1217) 2026-03-13 03:52:56 -07:00