diff --git a/pkg/assume/assume.go b/pkg/assume/assume.go index 09717345..687e3780 100644 --- a/pkg/assume/assume.go +++ b/pkg/assume/assume.go @@ -365,7 +365,7 @@ func AssumeCommand(c *cli.Context) error { var l Launcher switch cfg.DefaultBrowser { - case browser.ChromeKey, browser.BraveKey, browser.EdgeKey, browser.ChromiumKey, browser.VivaldiKey: + case browser.ChromeKey, browser.BraveKey, browser.EdgeKey, browser.ChromiumKey, browser.VivaldiKey, browser.HeliumKey: l = launcher.ChromeProfile{ BrowserType: cfg.DefaultBrowser, ExecutablePath: browserPath, diff --git a/pkg/browser/browsers.go b/pkg/browser/browsers.go index b1a49550..6045aa3f 100644 --- a/pkg/browser/browsers.go +++ b/pkg/browser/browsers.go @@ -19,6 +19,7 @@ const ( FirefoxStdoutKey string = "FIREFOX_STDOUT" ArcKey string = "ARC" ZenKey string = "ZEN" + HeliumKey string = "HELIUM" FirefoxDevEditionKey string = "FIREFOX_DEV" FirefoxNightlyKey string = "FIREFOX_NIGHTLY" CustomKey string = "CUSTOM" @@ -66,6 +67,8 @@ var SafariPathMac = []string{"/Applications/Safari.app/Contents/MacOS/Safari"} var ArcPathMac = []string{"/Applications/Arc.app/Contents/MacOS/Arc"} +var HeliumPathMac = []string{"/Applications/Helium.app/Contents/MacOS/Helium"} + var ZenPathMac = []string{"/Applications/Zen Browser.app/Contents/MacOS/zen"} var ZenPathLinux = []string{`/usr/bin/zen-browser`, `/opt/zen-browser/zen`} var ZenPathWindows = []string{`\Program Files\Zen Browser\zen.exe`} @@ -256,6 +259,15 @@ func ArcPathDefaults() ([]string, error) { } } +func HeliumPathDefaults() ([]string, error) { + switch runtime.GOOS { + case "darwin": + return HeliumPathMac, nil + default: + return nil, errors.New("os not supported") + } +} + func ZenPathDefaults() ([]string, error) { path, err := exec.LookPath("zen-browser") if err == nil { diff --git a/pkg/browser/detect.go b/pkg/browser/detect.go index 28bfeda0..64549c26 100644 --- a/pkg/browser/detect.go +++ b/pkg/browser/detect.go @@ -50,7 +50,7 @@ func HandleManualBrowserSelection() (string, error) { withStdio := survey.WithStdio(os.Stdin, os.Stderr, os.Stderr) in := survey.Select{ Message: "Select one of the browsers from the list", - Options: []string{"Chrome", "Brave", "Edge", "Vivaldi", "Firefox", "Waterfox", "Chromium", "Safari", "Stdout", "FirefoxStdout", "Firefox Developer Edition", "Firefox Nightly", "Arc", "Zen", "Custom"}, + Options: []string{"Chrome", "Brave", "Edge", "Vivaldi", "Firefox", "Waterfox", "Chromium", "Safari", "Stdout", "FirefoxStdout", "Firefox Developer Edition", "Firefox Nightly", "Arc", "Zen", "Helium", "Custom"}, } var selection string clio.NewLine() @@ -142,6 +142,9 @@ func GetBrowserKey(b string) string { if strings.Contains(strings.ToLower(b), "zen") { return ZenKey } + if strings.Contains(strings.ToLower(b), "helium") { + return HeliumKey + } if strings.Contains(strings.ToLower(b), "custom") { return CustomKey } @@ -172,6 +175,8 @@ func DetectInstallation(browserKey string) (string, bool) { bPath, _ = SafariPathDefaults() case ArcKey: bPath, _ = ArcPathDefaults() + case HeliumKey: + bPath, _ = HeliumPathDefaults() case ZenKey: bPath, _ = ZenPathDefaults() case FirefoxDevEditionKey: diff --git a/pkg/granted/console.go b/pkg/granted/console.go index 38b3c6f2..4ecb027d 100644 --- a/pkg/granted/console.go +++ b/pkg/granted/console.go @@ -93,6 +93,10 @@ var ConsoleCommand = cli.Command{ l = launcher.ChromeProfile{ ExecutablePath: cfg.CustomBrowserPath, } + case browser.HeliumKey: + l = launcher.ChromeProfile{ + ExecutablePath: cfg.CustomBrowserPath, + } case browser.FirefoxKey: l = launcher.Firefox{ ExecutablePath: cfg.CustomBrowserPath, diff --git a/pkg/launcher/chrome_profile.go b/pkg/launcher/chrome_profile.go index 0925b024..93305e23 100644 --- a/pkg/launcher/chrome_profile.go +++ b/pkg/launcher/chrome_profile.go @@ -55,6 +55,8 @@ var VivaldiPathMac = "Library/Application Support/Vivaldi/Local State" var VivaldiPathLinux = ".config/vivaldi/Local State" var VivaldiPathWindows = `AppData\Local\Vivaldi\User Data/Local State` +var HeliumPathMac = "Library/Application Support/net.imput.helium/Local State" + // setProfileName attempts to rename an existing Chrome profile from 'Person 2', 'Person 3', etc // into the name of the AWS profile that we're launching. // @@ -222,6 +224,9 @@ func getLocalStatePath(browserType string) (stateFile string, err error) { case browser.VivaldiKey: stateFile = path.Join(stateFile, VivaldiPathMac) + + case browser.HeliumKey: + stateFile = path.Join(stateFile, HeliumPathMac) } case "linux":