-
Notifications
You must be signed in to change notification settings - Fork 0
/
find.go
41 lines (32 loc) · 921 Bytes
/
find.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//go:build linux || freebsd || openbsd || netbsd || dragonfly || solaris
package browsh
import (
"os"
"path/filepath"
"github.com/dvgamerr-app/go-kooky"
"github.com/dvgamerr-app/go-kooky/internal/cookies"
"github.com/dvgamerr-app/go-kooky/internal/firefox"
)
type browshFinder struct{}
var _ kooky.CookieStoreFinder = (*browshFinder)(nil)
func init() {
kooky.RegisterFinder(`browsh`, &browshFinder{})
}
func (f *browshFinder) FindCookieStores() ([]kooky.CookieStore, error) {
dotConfig, err := os.UserConfigDir()
if err != nil {
return nil, err
}
var ret = []kooky.CookieStore{
&cookies.CookieJar{
CookieStore: &firefox.CookieStore{
DefaultCookieStore: cookies.DefaultCookieStore{
BrowserStr: `browsh`,
IsDefaultProfileBool: true,
FileNameStr: filepath.Join(dotConfig, `browsh`, `firefox_profile`, `cookies.sqlite`),
},
},
},
}
return ret, nil
}