Skip to content

Release v0.4.2

Compare
Choose a tag to compare
@github-actions github-actions released this 04 Mar 20:29

bichrome

bichrome is a simple utility for Windows and macOS that you configure as your default browser, which then will choose which browser to open a URL in based on the configuration you specify. It also supports picking a particular Chrome profile -- either by specifying a profile name, or by specifying the "hosted domain" of your profile if you're using Google Workspace. (Your hosted domain is the bit after the @ in a non-"gmail dot com" address hosted by GMail.)

It was created to address the problem of clicking links in Slack and other apps and then having to relocate them to the "correct" browser window / Chrome profile where you're logged in to Facebook / JIRA / etc.

Big thanks to Krista A. Leemhuis for the amazing icon!

Installation

Windows

  1. Download bichrome-win64.exe from this release.
  2. Move it to its permanent home -- e.g. creating a directory in %localappdata%\Programs called bichrome and putting it there.
  3. Run bichrome-win64.exe once by double clicking it. This will register bichrome as a potential browser.
  4. Configure bichrome as your default browser by opening "Default Apps" (You can open your start menu and just type "Default Apps") and clicking the icon under "Web browser", and picking bichrome.

That's it! Now just create a configuration file named bichrome_config.json next to bichrome-win64.exe (see the configuration section for details) -- a good starting place is to download & edit the example config.

macOS

  1. Download bichrome-macos.zip from this release.
  2. Extract it and copy the bichrome app e.g. to /Applications
  3. Open System Preferences and search for "Default Browser"
  4. Pick bichrome as youre default browser.

That's it! Now just create a configuration file named bichrome_config.json in ~/Library/Application Support/com.bitspatter.bichrome/bichrome_config.json (see the configuration section for details) -- a good starting place is to download & edit the example config.

bichrome_config.json

Configuring bichrome involves setting up a set of profiles that define a name and a browser (and for Chrome, optionally a browser profile name or a profile's hosted domain), and setting up a list of profile selectors that pick a profile based on matching patterns against the URL you're opening.

The following snippet shows how profiles are configured. See the example config for a more complete example.

{
  "default_profile": "Personal",
  "profiles": {
    "Work": {
      "browser": "Chrome",
      "hosted_domain": "mycorp.com"
    },
    "Personal": {
      "browser": "Firefox"
    }
  },
  "profile_selection": [ ... ]
}

The format for the patterns are documented in detail on Mozilla.org or in the documentation of the webextension_pattern crate which is used to perform the matching. Some examples can be found in the the example config.

Configuring the matching is done under the profile_selection key. The browser from the first selector that matches the URL will be used to open the URL. If none of the patterns match, the URL will be opened with the profile named in default_profile, and if that doesn't exist, it will default to using Chrome with no profile specified. (Chrome's behavior in this case is to open it in the last activated window.) A profile specifying a browser of Safari, Edge, or OsDefault will use Safari on macOS and Edge on Windows.

The following snippet shows how selectors are configured. See the example config for a more complete example.

{
  "default_profile": "...",
  "profiles": { ... },
  "profile_selection": [
    {
        "profile": "Personal",
        "pattern": "*.twitter.com"
    },
    {
        "profile": "Work",
        "pattern": "*.mycorp.net"
    }
  ]
}

bichrome_config.json is expected to live next to bichrome-win64.exe on Windows, and in ~/Library/Application Support/com.bitspatter.bichrome/bichrome_config.json on macOS.

You can find an example config in example_config/bichrome_config.json.