cmux/Sources
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
..
Find Add browser find focus debug logs (#1162) 2026-03-10 19:31:52 -07:00
Panels feat: support window.open() popup windows (#1150) 2026-03-15 17:48:05 -07:00
Update Fix titlebar shortcut hint clipping (#1259) 2026-03-12 03:27:10 -07:00
AppDelegate.swift feat: support window.open() popup windows (#1150) 2026-03-15 17:48:05 -07:00
AppleScriptSupport.swift Update ghostty to v1.3.0 (#1142) 2026-03-09 21:32:54 -07:00
Backport.swift Resync terminal portals after sidebar changes (#1253) 2026-03-12 02:46:30 -07:00
BrowserWindowPortal.swift Merge pull request #1230 from manaflow-ai/issue-1183-devtools-side-dock-guard 2026-03-11 23:32:19 -07:00
cmuxApp.swift feat: support window.open() popup windows (#1150) 2026-03-15 17:48:05 -07:00
ContentView.swift Add configurable sidebar tint color with light/dark mode support (#1465) 2026-03-15 15:48:57 -07:00
GhosttyConfig.swift Add configurable sidebar tint color with light/dark mode support (#1465) 2026-03-15 15:48:57 -07:00
GhosttyTerminalView.swift Fix main CI regressions (#1458) 2026-03-15 02:04:33 -07:00
KeyboardLayout.swift Fix Dvorak Cmd+C colliding with notifications shortcut (#762) 2026-03-05 18:32:42 -08:00
KeyboardShortcutSettings.swift Revert "Add workspace pages in the titlebar (#1030)" (#1040) 2026-03-07 00:05:58 -08:00
NotificationsPage.swift Add Jump to Latest to the notifications popover (#1167) 2026-03-10 19:30:17 -07:00
PortScanner.swift Avoid main-thread hops for explicit socket scope 2026-02-20 23:58:47 -08:00
PostHogAnalytics.swift Flush PostHog hourly active events immediately (#934) 2026-03-05 04:00:04 -08:00
SentryHelper.swift Auto-heal missing CLI listener socket (#679) 2026-02-28 01:19:38 -08:00
SessionPersistence.swift Allow smaller sidebar widths (#1420) 2026-03-13 21:40:25 -07:00
SidebarSelectionState.swift Implement session persistence pass 1 with multi-window restore 2026-02-22 15:39:59 -08:00
SocketControlSettings.swift Fallback stable socket listener to a user-scoped path (#1351) 2026-03-13 17:37:01 -07:00
TabManager.swift Fix stale Claude sidebar status: add missing hooks, OSC suppression, PID sweep (#1306) 2026-03-13 20:47:42 -07:00
TerminalController.swift Fix stale Claude sidebar status: add missing hooks, OSC suppression, PID sweep (#1306) 2026-03-13 20:47:42 -07:00
TerminalNotificationStore.swift Add settings to disable pane ring and flash (#1217) 2026-03-13 03:52:56 -07:00
TerminalView.swift Add sidebar blur effect with withinWindow blending (#9) 2026-02-04 03:04:45 -08:00
TerminalWindowPortal.swift Resync terminal portals after sidebar changes (#1253) 2026-03-12 02:46:30 -07:00
UITestRecorder.swift Fix frozen terminals after split churn (#12) 2026-02-13 16:45:31 -08:00
WindowAccessor.swift Polish browser suggestions, focus, and tagged reload flow 2026-02-14 21:33:28 -08:00
WindowDecorationsController.swift Refine settings/about titlebar styling and controls alignment 2026-02-14 02:11:35 -08:00
WindowDragHandleView.swift Fix re-entrant exclusive-access crash in drag handle hit test (#771) 2026-03-02 19:20:14 -08:00
WindowToolbarController.swift Revert "Merge pull request #239 from manaflow-ai/issue-151-ssh-remote-port-proxying" 2026-03-12 14:45:58 -07:00
Workspace.swift Fix stale Claude sidebar status: add missing hooks, OSC suppression, PID sweep (#1306) 2026-03-13 20:47:42 -07:00
WorkspaceContentView.swift Keep internal tab drags out of Finder 2026-03-10 21:41:42 -07:00