Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/assume/assume.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
12 changes: 12 additions & 0 deletions pkg/browser/browsers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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`}
Expand Down Expand Up @@ -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 {
Expand Down
7 changes: 6 additions & 1 deletion pkg/browser/detect.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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:
Expand Down
4 changes: 4 additions & 0 deletions pkg/granted/console.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
5 changes: 5 additions & 0 deletions pkg/launcher/chrome_profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
//
Expand Down Expand Up @@ -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":
Expand Down