[webkit-changes] [WebKit/WebKit] b66e48: REGRESSION(Safari 18): Web Extensions Fail to Set ...
Timothy Hatcher
noreply at github.com
Tue Oct 22 06:42:15 PDT 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: b66e4895df40202b14bb20fb47444c3e0a3c164e
https://github.com/WebKit/WebKit/commit/b66e4895df40202b14bb20fb47444c3e0a3c164e
Author: Timothy Hatcher <timothy at apple.com>
Date: 2024-10-22 (Tue, 22 Oct 2024)
Changed paths:
M Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPICookiesCocoa.mm
M Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebExtensionAPICookies.mm
Log Message:
-----------
REGRESSION(Safari 18): Web Extensions Fail to Set Cookies while expirationDate Exists.
https://webkit.org/b/281385
rdar://problem/137812683
Reviewed by Brian Weinstein.
The `cookies` extension API uses seconds since epoch, but internally the `WebCore::Cookie`
struct uses milliseconds since epoch. We need to convert to and from these values
when getting and setting the `expirationDate`.
Not doing this was effectively always setting a cookie that was already expired, so it would
not be returned again later.
* Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPICookiesCocoa.mm:
(WebKit::toWebAPI): Convert from milliseconds to seconds.
(WebKit::WebExtensionAPICookies::set): Convert from seconds to milliseconds.
* Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebExtensionAPICookies.mm:
(TestWebKitAPI::TEST(WKWebExtensionAPICookies, SetCookieWithExpirationDate)): Added.
Canonical link: https://commits.webkit.org/285552@main
To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications
More information about the webkit-changes
mailing list