Skip to content

feature: Tab movement to different Browser instances - #61

Open
dotWee wants to merge 2 commits into
AlexStrNik:mainfrom
dotWee:feature/browser-tab-switching
Open

feature: Tab movement to different Browser instances#61
dotWee wants to merge 2 commits into
AlexStrNik:mainfrom
dotWee:feature/browser-tab-switching

Conversation

@dotWee

@dotWee dotWee commented Aug 15, 2026

Copy link
Copy Markdown

Summary

Starting off with a use case:
Sometimes a tab is open in one browser (Chrome, Brave, etc) and it belongs in another (Safari, Edge).

Solving the via copy-pasting the tab url to another browser is easy, but AppleScript can this do too - I've used some hand-rolled AppleScript for most of the time: read the current tab URL, open it in the other browser, then close the original tab.

--Description: Move Safari tab to Google Chrome (and close original tab after)
tell application "Safari"
	--Variables
	set docText to ""
	
	--Select current tab
	set tabURL to URL of current tab of window 1
	
	--Append to variable
	set docText to docText & tabURL as string
	
	close current tab of window 1
end tell

tell application "Google Chrome"
	activate
	if (count of windows) is greater than 0 then
		set currentWindow to front window
	else
		make new window
		set currentWindow to front window
	end if
	
	make new tab at currentWindow with properties {URL:tabURL}
end tell

This PR builds that flow into Browserino. Trigger it from Move Current Tab... in the menu bar, or from a recordable global shortcut.

Browserino reads the frontmost (scriptable) browser’s current tab URL, shows the existing picker for the destination, opens the URL there, and closes the source tab only after that open succeeds.

Canceling the picker leaves the original tab alone. Shift / Shift+Return still opens the destination in private mode. Closing the source tab can be turned off under Preferences -> General -> Tab switching.

Short description how

The picker and NSWorkspace open path are unchanged. What is new is pulling a URL out of another app and optionally closing that tab.

  1. Trigger — global shortcut snapshots the frontmost app at key-down, before Browserino activates. The menu item uses the last non-Browserino app plus on-screen window z-order, so clicking the status item does not steal the source.
  2. Source — must be a browser in the configured Browsers list. If that front app is listed but not scriptable (e.g. Firefox), fail with an alert instead of silently using a browser behind it.
  3. Read URL — Apple Events by bundle ID (tell application id "..."), not localized app names. Safari: URL of current tab of window 1. Chromium family: URL of active tab of window 1.
  4. Picker — same UI, move mode: caption Moving from …, host-matched Apps hidden, source browser omitted, hidden browsers not offered. Empty destination list → alert, not an empty picker.
  5. Open then close — destination still goes through Launch Services. The source tab is closed via Apple Events only in the open completion handler, and only if the close-source toggle is on.

Scriptable sources: Safari / Safari Technology Preview; Chrome, Brave, Edge (including Beta/Dev/Canary/Nightly variants); Opera, Opera GX, Vivaldi, Arc, Chromium.

Not moved: empty URLs and start pages, browsers with no windows, internal pages (about:, chrome:, edge:, brave:, safari:, opera:, vivaldi:, chrome-extension:, edge-extension:). Firefox and other non-scriptable apps are out of scope. Only the URL is transferred — not cookies, history, or session.

macOS asks for Automation permission the first time Browserino controls a source browser (read + close). Denied access shows an alert with a link to System Settings -> Privacy & Security -> Automation. Opening the destination still uses Launch Services, so the destination does not need Automation access.

Also documents the existing feature set and this flow in the README.


Love the work on Browserino! Hope you know Browserino is even recommended by the fellow Browserosaurus creator :) Cheers and greets from Zurich!

dotWee added 2 commits August 15, 2026 18:47
Move the frontmost browser tab to another browser from the menu bar or a recordable global shortcut.

Reuse the existing picker for the destination and close the original tab only after a successful open.

Support Safari and Chromium-family browsers through Apple Events, and ask for Automation permission on first use.

Document the flow, supported browsers, and limitations in the readme.
@dotWee
dotWee force-pushed the feature/browser-tab-switching branch from 8f1c4d1 to 676c0fd Compare August 15, 2026 18:13
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.

1 participant