https://github.com/webpro/browser-tab-bridge
Focus or open a URL in the default browser tab (macOS-only)
https://github.com/webpro/browser-tab-bridge
Last synced: about 1 month ago
JSON representation
Focus or open a URL in the default browser tab (macOS-only)
- Host: GitHub
- URL: https://github.com/webpro/browser-tab-bridge
- Owner: webpro
- Created: 2026-03-03T06:45:49.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2026-05-19T07:55:43.000Z (3 months ago)
- Last Synced: 2026-05-19T10:35:11.404Z (3 months ago)
- Language: TypeScript
- Size: 16.6 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# browser-tab-bridge
Read and control browser tabs from outside the browser. macOS only for now.
## Usage
```js
import { openInBrowserTab, getActiveTabUrl } from "browser-tab-bridge";
// Focus an existing tab or open a new one
await openInBrowserTab("https://github.com");
// Get the URL of the active browser tab
const url = await getActiveTabUrl();
```
## Browser support
| Browser | Method | Setup required |
| -------------------- | ---------------------------------------------- | --------------- |
| Chrome, Chrome-based | AppleScript | None |
| Safari | AppleScript | None |
| Firefox, Zen | Companion WebExtension + native messaging host | Yes (see below) |
For unsupported browsers, falls back to the system `open` command.
## Firefox / Zen setup
1. Build the `.xpi` files and native messaging host:
```sh
pnpm build
```
2. Install the browser extension via "Install Add-on From File" (`about:addons`):
- Firefox: `extension/firefox/firefox.xpi`
- Zen: `extension/zen/zen.xpi`
Note: Regular Firefox requires signed extensions. Either use Firefox Developer
Edition (set `xpinstall.signatures.required` to `false` in `about:config`) or
sign the .xpi as unlisted on [addons.mozilla.org](https://addons.mozilla.org).
3. Install the native messaging host:
```sh
pnpm install:firefox
# or
pnpm install:zen
```
## License
ISC