fix(time): correct export data timestamp conversions (#586)

This commit is contained in:
Roger
2026-04-23 20:39:56 +08:00
committed by GitHub
parent 0c6c781567
commit 50c4ea84cb
14 changed files with 228 additions and 30 deletions
+4 -2
View File
@@ -20,6 +20,8 @@ func extractCookies(path string) ([]types.CookieEntry, error) {
for _, page := range pages {
for _, c := range page.Cookies {
hasExpire := !c.Expires.IsZero()
// binarycookies returns time.Time in Local; normalize to UTC
// so exported JSON matches Chromium/Firefox cookie output.
cookies = append(cookies, types.CookieEntry{
Host: string(c.Domain),
Path: string(c.Path),
@@ -29,8 +31,8 @@ func extractCookies(path string) ([]types.CookieEntry, error) {
IsHTTPOnly: c.HTTPOnly,
HasExpire: hasExpire,
IsPersistent: hasExpire,
ExpireAt: c.Expires,
CreatedAt: c.Creation,
ExpireAt: c.Expires.UTC(),
CreatedAt: c.Creation.UTC(),
})
}
}