| Summary: | Web Inspector: Copy cookie as Netscape HTTP Cookie File format | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Ryan Govostes <rgovostes+wk> |
| Component: | Web Inspector | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW --- | ||
| Severity: | Enhancement | CC: | inspector-bugzilla-changes, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | Safari 14 | ||
| Hardware: | All | ||
| OS: | All | ||
|
Description
Ryan Govostes
2020-12-23 07:10:18 PST
Probably a bad attempt at a function to convert the tabular format that gets copied now to the cookies.txt format. Assumes the column visibility and ordering settings (which I think are default).
(function (cookies) {
return "# Netscape HTTP Cookie File\n" + cookies.split("\n").map( (cookie) => {
let [name, value, domain, path, expires, size, secure, httponly, samesite] = cookie.split("\t")
expires = Date.parse(expires) / 1000
return domain + "\t" + (!!samesite ? "FALSE" : "TRUE") + "\t" + path + "\t" + (!!secure ? "FALSE" : "TRUE") + "\t" + expires + "\t" + name + "\t" + value
}).join("\n")
})(the_cookies)
|