forked from browserutils/kooky
-
Notifications
You must be signed in to change notification settings - Fork 0
/
find.go
39 lines (33 loc) · 835 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
package ie
import (
"github.com/favbox/kooky"
"github.com/favbox/kooky/internal/cookies"
"github.com/favbox/kooky/internal/ie"
_ "github.com/favbox/kooky/internal/ie/find"
)
type ieFinder struct{}
var _ kooky.CookieStoreFinder = (*ieFinder)(nil)
func init() {
kooky.RegisterFinder(`ie`, &ieFinder{})
}
func (f *ieFinder) FindCookieStores() ([]kooky.CookieStore, error) {
roots, _ := ieRoots()
var cookiesFiles []kooky.CookieStore
for _, root := range roots {
cookiesFiles = append(
cookiesFiles,
&cookies.CookieJar{
CookieStore: &ie.CookieStore{
CookieStore: &ie.TextCookieStore{
DefaultCookieStore: cookies.DefaultCookieStore{
BrowserStr: `ie`,
IsDefaultProfileBool: true,
FileNameStr: root,
},
},
},
},
)
}
return cookiesFiles, nil
}