Skip to content

Instantly share code, notes, and snippets.

@inchoate
Last active April 24, 2024 09:37
Show Gist options
  • Star 29 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save inchoate/5736cc1257066edd8fa643ca594a4778 to your computer and use it in GitHub Desktop.
Save inchoate/5736cc1257066edd8fa643ca594a4778 to your computer and use it in GitHub Desktop.
Open clicked URLs into a particular Google Chrome profile

Problem

When I click on links from Slack or Outlook on MacOS they open in seemingly random browser windows/profiles. This is annoying.

Solution

Open links in a particular google chrome profile window. Be less annoyed.

  1. In Chrome, visit chrome://version and find the desired profile name. Mine was Default. Copy that profile's directory name, like Profile 2 or Default, not the profile's vanity name you see when you click on your profile icon in the browser.
  2. Install Finicky: brew install finicky. After install it should be running and you should see the icon in the upper toolbar.
  3. From the Finicky Toolbar Item, click > Config > Create New
  4. Edit the new file ~/.finicky and make it look something like this, filling in your profile name:
module.exports = {
  defaultBrowser: "Google Chrome",
  options: {
    hideIcon: false,
    checkForUpdate: true,
  },
  handlers: [
    {
      match: ({ opener }) =>
        ["Slack", "Microsoft Outlook"].includes(opener.name),
      browser: {
        name: "Google Chrome",
        profile: "Default",
      },
    },
    {
      match: ({ url }) => url.protocol === "slack",
      browser: "/Applications/Slack.app",
    },
  ],
};
  1. Reload Finicky from the toolbar: > Config > Reload.
  2. Done. Enjoy.
@bpr10
Copy link

bpr10 commented Dec 16, 2022

Worked like a charm! This is such a lifesaver. Thanks for posting this.

@rasisrazali
Copy link

Thank you fellow human, this ease my pain since the Chrome's update

@rickwillcox
Copy link

Excellent, worked straight away.

@kcbaltz
Copy link

kcbaltz commented Mar 18, 2023

Excellent stuff.
Your instructions were just right, but I'd recommend a note for skimmers like me. In Step #1 the name is likely not the same as the friendly name you may have given a profile, the one that you see when you click on the profile's icon. E.g.

Note: the name you're looking for is the directory name, not the friendly name you see when you click your profile icon in the browser.

@inchoate
Copy link
Author

👍 Updated, thanks @kcbaltz.

@samdaviesudina
Copy link

Worked like a charm! Thank you so much for posting this.

@uurtsaikhb
Copy link

OMG, thank you very much

@krlooss
Copy link

krlooss commented Jun 14, 2023

I had to name the file ~/.finicky.js for it to detect it

@ChigboIO
Copy link

ChigboIO commented Aug 1, 2023

This is great! Works like a charm! Thanks!! I also found this alternate tool (Open in Profile) but I am preferring Finicky

@cupofjoakim
Copy link

It works! Thanks, this will save me from a lot of frustration

@pierreact
Copy link

Between this, non-waterproof keyboard and the inability to rename desktops in mac, I wonder more and more what justifies the price.

@igormukhin
Copy link

What is an alternative for Windows?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment