Brouter is a small macOS app that acts as a programmable default browser. Instead of opening every link the same way, it routes URLs to different commands based on simple regex rules.
When macOS opens a URL, Brouter finds the first matching rule and executes its command.
Run this command to download and install the latest release into ~/Applications:
curl -fsSL https://raw.githubusercontent.com/codecorrupt/brouter/main/install.sh | bash
After installation, set Brouter as your default browser in System Settings.
The installer also creates an example configuration file, but you must edit it to match your browsers and preferences before Brouter will be useful.
- Download the latest
Brouter.appfrom the GitHub releases page. - Move it into your
~/Applicationsfolder. - Remove macOS quarantine attributes:
xattr -cr ~/Applications/Brouter.app
- Set Brouter as your default browser in System Settings.
- Build and install the app into
~/Applications:make install
- Then open System Settings to set it as the default browser:
make open-default-browser-settings
-
Create a config file in
${XDG_CONFIG_HOME:-~/.config}/brouter/config -
Each line defines a routing rule:
<regex> <command...>- Rules are evaluated top to bottom; first match wins
- Lines starting with
#and empty lines are ignored
-
Example:
# Open youtube and twitch in my personal profile .*youtube\.com.* open -na "Google Chrome" --args --profile-directory="Personal" .*twitch\.com.* open -na "Google Chrome" --args --profile-directory="Personal" # Open everything else in my work profile .* open -na "Google Chrome" --args --profile-directory="Work" -
./src/example-confighas more examples for common browsers