8000 fix(browser): open Ctrl+click and middle-click links in a new tab by jpstratman · Pull Request #446 · amirlehmam/wmux · GitHub
[go: up one dir, main page]

Skip to content

fix(browser): open Ctrl+click and middle-click links in a new tab - #446

Merged
amirlehmam merged 1 commit into
amirlehmam:masterfrom
jpstratman:fix/browser-ctrl-click-new-tab
Nov 9, 2026
Merged

amirlehmam merged 1 commit into
amirlehmam:masterfrom
jpstratman:fix/browser-ctrl-click-new-tab

Conversation

@jpstratman
Copy link
Copy Markdown
Contributor

Ctrl+click or middle-click on a link in a browser tab used to replace the current page. Now the link opens in a new browser tab next to the current one, and you stay on the page you clicked.

Chromium reports both clicks as a background-tab window-open request. webviewWindowOpenPolicy sends that request to its own new-tab path. Main then tells the host window which guest asked, the same way BROWSER_GUEST_KEY does, and the pane hosting that guest adds the tab. It reuses the onOpenInNewTab path from the right-click menu (#439).

Design choices:

  • The new tab opens in the background, as it does in a browser. The right-click menu still opens a tab in the foreground.
  • Only background-tab gets the new path. Ctrl+Shift+click arrives as foreground-tab, the same as a page's own window.open(), so it still opens in place.
  • The side panel has no tabs, so it sends the link to the same place the right-click menu does.

Chromium reports both gestures as a 'background-tab' window-open request,
which the browser pane used to turn into an in-place navigation. Main now
routes that disposition to the window hosting the guest, and the pane adds
a browser tab beside it without switching to it, as a browser would. The
side panel has no tabs, so it uses the same destination as the right-click
"Open link in new tab" (amirlehmam#439).
@amirlehmam
amirlehmam merged commit e89ebe2 into amirlehmam:master Nov 9, 2026
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.

2 participants

0