open-in-browser-tab
v0.0.2
Published
Focus or open a URL in the default browser tab (macOS-only)
Downloads
213
Readme
open-in-browser-tab
Focus an existing browser tab matching a URL, or open a new one. macOS only.
Usage
import { openInBrowserTab } from "open-in-browser-tab";
await openInBrowserTab("https://github.com");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
Build the
.xpifiles and native messaging host:pnpm buildInstall the browser extension via "Install Add-on From File" (
about:addons):- Firefox:
extension/firefox/firefox.xpi - Zen:
extension/zen/zen.xpi
- Firefox:
Install the native messaging host:
pnpm install:firefox # or pnpm install:zen
License
ISC
