nref / BrowseRouter

In Windows, launch a different browser depending on the url
MIT License
126 stars 12 forks source link

BrowseRouter

In Windows, launch a different browser depending on the url.

Usage

    BrowseRouter.exe [-h | --help]
        Show help.

    BrowseRouter.exe
        Automatic registration. 
        Same as --register if not already registered, otherwise --unregister.
        If the app has moved or been renamed, updates the existing registration.

    BrowseRouter.exe [-r | --register]
        Register as a web browser, then open Settings. 
        The user must choose BrowseRouter as the default browser.
        No need to run as admin.

    BrowseRouter.exe [-u | --unregister]
        Unregister as a web browser. 

    BrowseRouter.exe https://example.org/ [...more URLs]
        Launch one or more URLs

Setting Up

  1. Download the latest release.
  2. Open config.ini and customize as desired.
  3. Run BrowseRouter.exe without arguments. No need to run as admin. It will register with Windows as a web browser and open the Settings app. To unregister, run it again. If you later move BrowseRouter to a new folder, or rename the exe, run it again to update the registration.
  4. In the settings app, set BrowseRouter as the default browser.
Settings

Supported Platforms

Why?

BrowseRouter becomes your default "browser". When you click a link, it decides which real browser to launch. If you have multiple browsers installed, this is very useful. Example use cases:

Security

BrowseRouter is clean software. I, @nref, rest my reputation on it.

Privacy

BrowseRouter contains no tracking, and it makes no network connections of its own whatsoever.

Your system administrator could know which pages you are visiting by auditing process start logs e.g. BrowseRouter.exe http://some-naughty-site.example. They would have the same information for any browser.

Notifications

By default, BrowseRouter will show a desktop notification when it opens a link. You can disable this in config.ini.

Notification

Config

Config is a poor man's INI file:

[notify]
# Show a desktop notification when opening a link. Defaults to true
enabled = true

[log]
# Write log entries to a file. Defaults to false
enabled = true
# Defaults to C:\Users\<user>\AppData\Local\BrowseRouter\yyyy-MM-dd.log
#file = "C:\Users\<user>\Desktop\BrowseRouter.log"

# Default browser is first in list
# Use `{url}` to specify UWP app browser details
[browsers]
ff = C:\Program Files\Mozilla Firefox\firefox.exe
# Open in a new window
#chrome = "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --new-window
chrome = C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
edge = C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe

# Url preferences.
# - Only * is treated as a special character (wildcard).
# - Only domains are matched. Don't include protocols e.g. "https://" or paths e.g. "/some/path?query=value"
# - Beware that subdomains don't match automatically, e.g. "youtube.com = chrome" would not launch Chrome for "www.youtube.com"
#   For that reason, you'll often want a leading "*." e.g. "*.youtube.com". 
#   Note: Don't use "*youtube.com" as that would also match e.g. "notyoutube.com".
[urls]
*.google.com = chrome
*.youtube.com = chrome
*.visualstudio.com = edge
*.mozilla.org = ff

# Source preferences.
# Only * is treated as a special character (wildcard).
# Matches on window title of application used to open link.
# Applied regardless of any url preference match.
[sources]
* - Notepad = ff
Slack | Test = chrome
# Default case. Added automatically
# * = whatever

Browsers

Sources

Urls

There are two ways to specify an Url. You can use simple wildcards or full regular expressions.

Simple wildcards:

microsoft.com = ie
*.microsoft.com = ie

Full regular expressions:

  /sites\.google\.com/a/myproject.live\.com/ = chrome

Sources

Wildcards and full regular expressions may also be used to match source window titles.

Logs

Logs are stored by default in %localappdata%/BrowseRouter/. For example, if you user name is joe, then the logs will be in C:\Users\joe\AppData\Local\BrowseRouter\.

You can change the directory in the [log] section of config.ini.

You can enable disable or log files by setting enabled = true or false in the [log] section of config.ini. If enabled is missing or doesn't equal true, logs will not be written.

Log entries are also written to the console and can be seen if e.g. if launched from Command Prompt, PowerShell, or Windows Terminal.

Credit

This is a fork of BrowserSelector. That version is no longer mantained. This version carries on the vision, fixing bugs and adding new features.

Support

If you like BrowseRouter, let me know in a discussion. BrowseRouter is just a hobby. You can help support continued development by "buying me a coffee."

Buy Me A Coffee

You can help determine what happens next with BrowseRouter by filling out this survey.