browserutils / kooky

Go code to read cookies from browser cookie stores.
MIT License
204 stars 41 forks source link

fix: compatible chrome cookie file position change #51

Closed rogerogers closed 2 years ago

rogerogers commented 2 years ago

Inlatest version of chrome, cookie file position has changed

srlehn commented 2 years ago

it is enough to check the name of the directory (it is now in the "Network" folder) containing the Cookies database, that saves the file stat.

dir := filepath.Dir(s.FileNameStr)
if filepath.Base(dir) == `Network` { // Chrome 96
        dir = filepath.Dir(dir)
}
stateFile, err := filepath.Abs(filepath.Join(filepath.Dir(dir), `Local State`))
...