browsers

package
v0.2.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 7, 2022 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ChromeKey        string = "CHROME"
	FirefoxKey       string = "FIREFOX"
	FirefoxStdoutKey string = "FIREFOX_STDOUT"
	EdgeKey          string = "EDGE"
	BraveKey         string = "BRAVE"
	StdoutKey        string = "STDOUT"
	ChromiumKey      string = "CHROMIUM"
)

Variables

View Source
var BravePathLinux = []string{`/usr/bin/brave-browser`, `/../../mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe`}
View Source
var BravePathMac = []string{"/Applications/Brave Browser.app/Contents/MacOS/Brave Browser"}
View Source
var BravePathWindows = []string{`\Program Files\BraveSoftware\Brave-Browser\Application\brave.exe`}
View Source
var ChromePathLinux = []string{`/usr/bin/google-chrome`, `/../../mnt/c/Program Files/Google/Chrome/Application/chrome.exe`, `/../../mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe`}
View Source
var ChromePathMac = []string{"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"}

A few default paths to check for the browser

View Source
var ChromePathWindows = []string{`\Program Files\Google\Chrome\Application\chrome.exe`, `\Program Files (x86)\Google\Chrome\Application\chrome.exe`}
View Source
var ChromiumPathLinux = []string{`/usr/bin/chromium`, `/../../mnt/c/Program Files/Chromium/chromium.exe`}
View Source
var ChromiumPathMac = []string{"/Applications/Chromium.app/Contents/MacOS/Chromium"}
View Source
var ChromiumPathWindows = []string{`\Program Files\Chromium\chromium.exe`}
View Source
var EdgePathLinux = []string{`/usr/bin/edge`, `/../../mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe`}
View Source
var EdgePathMac = []string{"/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge"}
View Source
var EdgePathWindows = []string{`\Program Files (x86)\Microsoft\Edge\Application\msedge.exe`}
View Source
var FirefoxPathLinux = []string{`/usr/bin/firefox`, `/../../mnt/c/Program Files/Mozilla Firefox/firefox.exe`}
View Source
var FirefoxPathMac = []string{"/Applications/Firefox.app/Contents/MacOS/firefox"}
View Source
var FirefoxPathWindows = []string{`\Program Files\Mozilla Firefox\firefox.exe`}
View Source
var ServiceMap = map[string]string{
	"":               "console",
	"ec2":            "ec2/v2",
	"sso":            "singlesignon",
	"ecs":            "ecs",
	"eks":            "eks",
	"athena":         "athena",
	"cloudmap":       "cloudmap",
	"c9":             "cloud9",
	"cfn":            "cloudformation",
	"cloudformation": "cloudformation",
	"cloudwatch":     "cloudwatch",
	"gd":             "guardduty",
	"l":              "lambda",
	"cw":             "cloudwatch",
	"cf":             "cloudfront",
	"ct":             "cloudtrail",
	"ddb":            "dynamodbv2",
	"eb":             "elasticbeanstalk",
	"ebs":            "elasticbeanstalk",
	"ecr":            "ecr",
	"grafana":        "grafana",
	"lambda":         "lambda",
	"route53":        "route53/v2",
	"r53":            "route53/v2",
	"s3":             "s3",
	"secretsmanager": "secretsmanager",
	"iam":            "iamv2",
	"waf":            "wafv2",
	"rds":            "rds",
	"dms":            "dms/v2",
	"mwaa":           "mwaa",
	"param":          "systems-manager/parameters",
	"redshift":       "redshiftv2",
	"sagemaker":      "sagemaker",
	"ssm":            "systems-manager",
}

ServiceMap maps CLI flags to AWS console URL paths. e.g. passing in `-r ec2` will open the console at the ec2/v2 URL.

Functions

func AskAndGetBrowserPath added in v0.1.17

func AskAndGetBrowserPath() (string, error)

func BravePathDefaults added in v0.1.8

func BravePathDefaults() ([]string, error)

func ChromePathDefaults added in v0.1.8

func ChromePathDefaults() ([]string, error)

func ChromiumPathDefaults added in v0.1.8

func ChromiumPathDefaults() ([]string, error)

func ConfigureBrowserSelection added in v0.1.1

func ConfigureBrowserSelection(browserName string, path string) error

ConfigureBrowserSelection will verify the existance of the browser executable and promot for a path if it cannot be found

func DetectInstallation added in v0.1.1

func DetectInstallation(browserKey string) (string, bool)

DetectInstallation checks if the default filepath exists for the browser executables on the current os returns the detected path

func EdgePathDefaults added in v0.1.8

func EdgePathDefaults() ([]string, error)

func Find

func Find() (string, error)

finds out which browser the user has as default

func FirefoxPathDefaults added in v0.1.8

func FirefoxPathDefaults() ([]string, error)

func GetBrowserKey added in v0.1.8

func GetBrowserKey(b string) string

func GrantedIntroduction

func GrantedIntroduction()

func HandleBrowserWizard

func HandleBrowserWizard(ctx *cli.Context) (string, error)

func HandleLinuxBrowserSearch added in v0.1.1

func HandleLinuxBrowserSearch() (string, error)

func HandleManualBrowserSelection

func HandleManualBrowserSelection() (string, error)

func HandleOSXBrowserSearch added in v0.1.1

func HandleOSXBrowserSearch() (string, error)

func HandleWindowsBrowserSearch added in v0.1.1

func HandleWindowsBrowserSearch() (string, error)

func LaunchConsoleSession

func LaunchConsoleSession(sess Session, opts BrowserOpts, service string, region string) error

func MakeFirefoxContainerURL added in v0.1.8

func MakeFirefoxContainerURL(urlString string, ops BrowserOpts) string

func MakeUrl added in v0.1.8

func MakeUrl(sess Session, opts BrowserOpts, service string, region string) (string, error)

func ManuallyOpenURL added in v0.1.8

func ManuallyOpenURL(url string)

func OpenUrlWithCustomBrowser added in v0.1.17

func OpenUrlWithCustomBrowser(url string) error

func OpenWithChromiumProfile

func OpenWithChromiumProfile(url string, labels BrowserOpts, selectedBrowser Browser) error

func OpenWithFirefoxContainer

func OpenWithFirefoxContainer(urlString string, ops BrowserOpts) error

func PromoteUseFlags added in v0.1.1

func PromoteUseFlags(labels BrowserOpts)

func RunFirefoxExtensionPrompts

func RunFirefoxExtensionPrompts(firefoxPath string) error

func SSOBrowser added in v0.1.17

func SSOBrowser(grantedDefaultBrowser string) error

func UserHasDefaultBrowser

func UserHasDefaultBrowser(ctx *cli.Context) (bool, error)

Checks the config to see if the user has already set up their default browser

Types

type Array

type Array struct {
	//XMLName xml.Name `xml:"array"`
	Dict Dict `xml:"dict"`
}

type Browser

type Browser int
const (
	BrowerFirefox Browser = iota
	BrowserChrome
	BrowserBrave
	BrowserEdge
	BrowserChromium
	BrowserDefault
)

type BrowserOpts added in v0.1.14

type BrowserOpts struct {
	// the name of the role
	Profile string
	Region  string
	Service string
}

func (*BrowserOpts) MakeExternalFirefoxTitle added in v0.1.14

func (r *BrowserOpts) MakeExternalFirefoxTitle() string

func (*BrowserOpts) MakeExternalProfileTitle added in v0.1.14

func (r *BrowserOpts) MakeExternalProfileTitle() string

type Dict

type Dict struct {
	//XMLName xml.Name `xml:"dict"`
	Key     []string `xml:"key"`
	Dict    IntDict  `xml:"dict"`
	Strings []string `xml:"string"`
}

type IntDict

type IntDict struct {
	//XMLName xml.Name `xml:"dict"`
	Key     string `xml:"key"`
	Strings string `xml:"string"`
}

type PartitionHost added in v0.1.15

type PartitionHost int
const (
	Default PartitionHost = iota
	Gov
	Cn
	ISO
	ISOB
)

func GetPartitionFromRegion added in v0.1.15

func GetPartitionFromRegion(region string) PartitionHost

func (PartitionHost) ConsoleHostString added in v0.1.15

func (p PartitionHost) ConsoleHostString() string

func (PartitionHost) HostString added in v0.1.15

func (p PartitionHost) HostString() string

func (PartitionHost) String added in v0.1.15

func (p PartitionHost) String() string

type Pdict

type Pdict struct {
	//XMLName xml.Name `xml:"dict"`
	Key   string `xml:"key"`
	Array Array  `xml:"array"`
}

type Session

type Session struct {
	SessionID    string `json:"sessionId"`
	SesssionKey  string `json:"sessionKey"`
	SessionToken string `json:"sessionToken"`
}

func SessionFromCredentials added in v0.1.6

func SessionFromCredentials(creds aws.Credentials) Session

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL