Choosy
Choosy is a browser chooser for macOS. Protocol Launcher allows you to generate URLs that open web links with Choosy.
Usage
There are two ways to use this library:
- On-Demand import from subpaths enables tree-shaking and keeps bundles small.
- Full Import from the root package is convenient but includes all app modules.
Pick On-Demand for production builds; Full Import is fine for quick scripts or demos.
Select Installation Method
On-Demand
Recommended. Optimized for production.
Full Import
Convenient. Good for quick scripts.
Notes
This module follows Choosy's official API documentation, where a URL is shaped as x-choosy://api-method/web-url.
The built-in helpers only cover the official API methods documented by Choosy: open, prompt.all, prompt.running, best.all, and best.running. Choosy also documents user-defined custom API methods, so customApiMethod accepts the method name configured in your Choosy rules.
Open
ts
import { open } from 'protocol-launcher/choosy'
const url = open({
url: 'https://example.com',
})Prompt All
ts
import { promptAll } from 'protocol-launcher/choosy'
const url = promptAll({
url: 'https://www.georgebrock.com',
})Prompt Running
ts
import { promptRunning } from 'protocol-launcher/choosy'
const url = promptRunning({
url: 'https://example.com',
})Best All
ts
import { bestAll } from 'protocol-launcher/choosy'
const url = bestAll({
url: 'https://example.com',
})Best Running
ts
import { bestRunning } from 'protocol-launcher/choosy'
const url = bestRunning({
url: 'https://example.com',
})Custom API Method
ts
import { customApiMethod } from 'protocol-launcher/choosy'
const url = customApiMethod({
method: 'edit',
url: 'https://www.example.com',
})