forked from browserutils/kooky
-
Notifications
You must be signed in to change notification settings - Fork 0
/
find.go
40 lines (31 loc) · 807 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
//go:build linux || freebsd || openbsd || netbsd || dragonfly || solaris
package elinks
import (
"os"
"path/filepath"
"github.com/etng/kooky"
"github.com/etng/kooky/internal/cookies"
)
type elinksFinder struct{}
var _ kooky.CookieStoreFinder = (*elinksFinder)(nil)
func init() {
kooky.RegisterFinder(`elinks`, &elinksFinder{})
}
func (f *elinksFinder) FindCookieStores() ([]kooky.CookieStore, error) {
home, err := os.UserHomeDir()
if err != nil {
return nil, err
}
var ret = []kooky.CookieStore{
&cookies.CookieJar{
CookieStore: &elinksCookieStore{
DefaultCookieStore: cookies.DefaultCookieStore{
BrowserStr: `elinks`,
IsDefaultProfileBool: true,
FileNameStr: filepath.Join(home, `.elinks`, `cookies`),
},
},
},
}
return ret, nil
}