|
|
@ -99,11 +99,12 @@ type Chromium struct { |
|
|
|
name string |
|
|
|
name string |
|
|
|
profilePath string |
|
|
|
profilePath string |
|
|
|
keyPath string |
|
|
|
keyPath string |
|
|
|
|
|
|
|
storage string // use for linux browser
|
|
|
|
secretKey []byte |
|
|
|
secretKey []byte |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func NewChromium(profile, key, name string) (Browser, error) { |
|
|
|
func NewChromium(profile, key, name, storage string) (Browser, error) { |
|
|
|
return &Chromium{profilePath: profile, keyPath: key, name: name}, nil |
|
|
|
return &Chromium{profilePath: profile, keyPath: key, name: name, storage: storage}, nil |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func (c *Chromium) GetName() string { |
|
|
|
func (c *Chromium) GetName() string { |
|
|
@ -149,7 +150,7 @@ type Firefox struct { |
|
|
|
keyPath string |
|
|
|
keyPath string |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func NewFirefox(profile, key, name string) (Browser, error) { |
|
|
|
func NewFirefox(profile, key, name, storage string) (Browser, error) { |
|
|
|
return &Firefox{profilePath: profile, keyPath: key, name: name}, nil |
|
|
|
return &Firefox{profilePath: profile, keyPath: key, name: name}, nil |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -221,7 +222,7 @@ func PickBrowser(name string) ([]Browser, error) { |
|
|
|
name = strings.ToLower(name) |
|
|
|
name = strings.ToLower(name) |
|
|
|
if name == "all" { |
|
|
|
if name == "all" { |
|
|
|
for _, v := range browserList { |
|
|
|
for _, v := range browserList { |
|
|
|
b, err := v.New(v.ProfilePath, v.KeyPath, v.Name) |
|
|
|
b, err := v.New(v.ProfilePath, v.KeyPath, v.Name, v.Storage) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
log.Error(err) |
|
|
|
log.Error(err) |
|
|
|
} |
|
|
|
} |
|
|
@ -229,7 +230,7 @@ func PickBrowser(name string) ([]Browser, error) { |
|
|
|
} |
|
|
|
} |
|
|
|
return browsers, nil |
|
|
|
return browsers, nil |
|
|
|
} else if choice, ok := browserList[name]; ok { |
|
|
|
} else if choice, ok := browserList[name]; ok { |
|
|
|
b, err := choice.New(choice.ProfilePath, choice.KeyPath, choice.Name) |
|
|
|
b, err := choice.New(choice.ProfilePath, choice.KeyPath, choice.Name, choice.Storage) |
|
|
|
browsers = append(browsers, b) |
|
|
|
browsers = append(browsers, b) |
|
|
|
return browsers, err |
|
|
|
return browsers, err |
|
|
|
} |
|
|
|
} |
|
|
|