johnste / finicky

A macOS app for customizing which browser to start
MIT License
3.67k stars 136 forks source link

Add chromeProfile utility on finiky api #304

Open expelledboy opened 1 year ago

expelledboy commented 1 year ago

I havent tested that this works, because I cant actually build this project.

In theory this is what I am looking for:

module.exports = {
  defaultBrowser: "Firefox",
  handlers: [
    {
      match: /slack/,
      browser: finiky.chromeProfile("work@email.com")
    },
  ]
};
expelledboy commented 1 year ago
#!/bin/bash

case "$(uname -s)" in

Darwin)
  CHROME_FOLDER="$HOME/Library/Application Support/Google/Chrome"
  ;;
Linux)
  CHROME_FOLDER="$HOME/.config/google-chrome"
  ;;
CYGWIN* | MINGW32* | MSYS* | MINGW*)
  CHROME_FOLDER="$HOME/AppData/Local/Google/Chrome"
  ;;
*)
  echo "Unsupported platform"
  exit 1
  ;;

esac

cat "$CHROME_FOLDER/Local State" |
  jq -r ".profile.info_cache | to_entries[] | {profile: .key, name: .value.name, user_name: .value.user_name}"
image
atulgpt commented 9 months ago

HI @johnste should we merge this PR? This seems to bring good value

johnste commented 8 months ago

I can have a look at this soon I hope