Skip to content

Open links in the right Chrome profile on Mac

On a Mac, a link clicked in Slack or Mail opens in whichever Chrome profile you used last. There are three ways to choose the profile instead: a Terminal command with --profile-directory, a link-router app set as your default browser, or Air Traffic Control rules in JustSidebar.

By the JustSidebar team · Last updated

Why links open in the wrong profile

macOS knows about browsers, not about profiles. When you click a link in another app, macOS hands the address to your default browser and nothing else. Chrome then opens it in the profile whose window was active most recently. If you were last in your personal profile, that's where the work ticket opens.

Method 1: a Terminal command

Chrome accepts a command-line switch that names the profile. It comes from Chromium and isn't described in Google's help pages, so check that it behaves as described on your Mac. First find the profile's folder name, which isn't the name you gave it:

  1. In a window of the profile you want, go to chrome://version.
  2. Read the line Profile Path. The last part is the folder name: Default for the first profile, then Profile 1, Profile 2 and so on.
  3. Open a link in that profile from Terminal:
open -na "Google Chrome" --args --profile-directory="Profile 1" "https://example.com"

To save typing, add a function per profile to ~/.zshrc:

work() { open -na "Google Chrome" --args --profile-directory="Profile 1" "$@"; }
home() { open -na "Google Chrome" --args --profile-directory="Default" "$@"; }

Then work https://example.com opens the page in the work profile. This costs nothing and needs no app, but it only helps for links you open yourself from a terminal or a script. It does nothing for a link you click in Slack.

Method 2: a link-router app

A link router is a small app you set as the default browser. It receives every clicked link, applies your rules, and forwards the link to a real browser, optionally to a given profile. Two established ones on the Mac:

  • Velja: rules are set in a settings window, by source app or by address, and can target a browser profile.
  • Finicky: open source, configured with a JavaScript file, which makes it very flexible if you're comfortable editing one.

Both can route by the app the link came from ("everything from Slack goes to Work"), which JustSidebar doesn't do. If link routing is the only thing you're missing, one of these is the right tool.

Method 3: Air Traffic Control in JustSidebar

JustSidebar includes the same idea under the name Arc gave it. You set JustSidebar as the default browser and add rules in Settings › Links:

ConditionTextSpace (Chrome profile)
Containsatlassian.netWork
Containsgithub.com/acmeWork
Starts withhttps://mail.google.com/mail/u/1Personal

The first matching rule decides; a link that matches nothing opens in the Space you used last. Since each Space is a Chrome profile, routing to a Space is routing to a profile. The difference from a standalone router is what happens next: the sidebar switches to that Space, so the link opens with its folders and favorites beside it. Details on the Air Traffic Control page.

Which one to pick

You wantPick
To open a profile from scripts or the command lineThe Terminal flag
Routing by source app, or between different browsersA link-router app
Routing by address, plus an Arc-style sidebar with SpacesJustSidebar
Nothing to installThe Terminal flag, and switching windows by hand

The same flag works for Brave and Edge with their own app names ("Brave Browser", "Microsoft Edge"), since both use Chromium's profile folders.

Keep reading

Keep your browser. Get your sidebar back.

JustSidebar for macOS 15 Sequoia and later. $29 one-time, 7-day free trial.

Download for Mac