Skip to content

Add [WKHTTPCookieStore getCookiesForURL:] API#57975

Merged
webkit-commit-queue merged 1 commit intoWebKit:mainfrom
beidson:eng/Add-WKHTTPCookieStore-getCookiesForURL-API
Feb 10, 2026
Merged

Add [WKHTTPCookieStore getCookiesForURL:] API#57975
webkit-commit-queue merged 1 commit intoWebKit:mainfrom
beidson:eng/Add-WKHTTPCookieStore-getCookiesForURL-API

Conversation

@beidson
Copy link
Contributor

@beidson beidson commented Feb 5, 2026

7475a7e

Add [WKHTTPCookieStore getCookiesForURL:] API
rdar://169719343
https://bugs.webkit.org/show_bug.cgi?id=307080

Reviewed by Richard Robinson.

[WKHTTPCookieStore _getCookiesForURL:] is proven SPI and many other clients could make great use of it.

Tests: Tools/TestWebKitAPI/Tests/WebKitCocoa/InAppBrowserPrivacy.mm
       Tools/TestWebKitAPI/Tests/WebKitCocoa/WKHTTPCookieStore.mm

* Source/WebKit/UIProcess/API/Cocoa/WKHTTPCookieStore.h:
* Source/WebKit/UIProcess/API/Cocoa/WKHTTPCookieStore.mm:
(-[WKHTTPCookieStore getCookiesForURL:completionHandler:]):
(-[WKHTTPCookieStore _getCookiesForURL:completionHandler:]):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/InAppBrowserPrivacy.mm:
(TEST(InAppBrowserPrivacy, GetCookieForURLFails)):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/WKHTTPCookieStore.mm:
(TEST(WKHTTPCookieStore, CookiesForURL)):

Canonical link: https://commits.webkit.org/307189@main

a71d7a7

Misc iOS, visionOS, tvOS & watchOS macOS Linux Windows Apple Internal
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 win ✅ 🛠 ios-apple
✅ 🧪 bindings ✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug ✅ 🧪 wpe-wk2 ✅ 🧪 win-tests loading 🛠 mac-apple
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ✅ 🧪 api-wpe ⏳ 🛠 vision-apple
✅ 🧪 ios-wk2-wpt ✅ 🧪 api-mac-debug ✅ 🛠 wpe-libwebrtc
✅ 🧪 api-ios ✅ 🧪 mac-wk1 ✅ 🛠 gtk
✅ 🛠 vision ✅ 🧪 mac-wk2 ✅ 🧪 gtk-wk2
✅ 🛠 vision-sim ✅ 🧪 mac-AS-debug-wk2 ✅ 🧪 api-gtk
✅ 🛠 🧪 merge ✅ 🧪 vision-wk2 ✅ 🧪 mac-wk2-stress ✅ 🛠 playstation
✅ 🛠 tv ✅ 🧪 mac-intel-wk2
✅ 🛠 tv-sim ✅ 🛠 mac-safer-cpp
✅ 🛠 watch
✅ 🛠 watch-sim

@beidson beidson requested a review from cdumez as a code owner February 5, 2026 17:52
@beidson beidson self-assigned this Feb 5, 2026
@beidson beidson force-pushed the eng/Add-WKHTTPCookieStore-getCookiesForURL-API branch from a4c0dc4 to 7522bd5 Compare February 10, 2026 05:59
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- (void)getCookiesForURL:(NSURL *)url completionHandler:(NS_SWIFT_UI_ACTOR void (^)(NSArray<NSHTTPCookie *> *))completionHandler NS_SWIFT_NAME(getCookies(for:completionHandler:)) WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA), visionos(WK_XROS_TBA));

(no need for the WK_ version, especially in public API)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry idk why the diff didn’t work but I mean WK_SWIFT_UI_ACTOR -> NS_SWIFT_UI_ACTOR

@rr-codes
Copy link
Contributor

you can also add a test to WKWebViewSwiftOverlayTests.swift to verify it compiles with the correct Swift signature, if you want

@beidson beidson force-pushed the eng/Add-WKHTTPCookieStore-getCookiesForURL-API branch from 7522bd5 to a71d7a7 Compare February 10, 2026 06:23
@beidson beidson added the merge-queue Applied to send a pull request to merge-queue label Feb 10, 2026
rdar://169719343
https://bugs.webkit.org/show_bug.cgi?id=307080

Reviewed by Richard Robinson.

[WKHTTPCookieStore _getCookiesForURL:] is proven SPI and many other clients could make great use of it.

Tests: Tools/TestWebKitAPI/Tests/WebKitCocoa/InAppBrowserPrivacy.mm
       Tools/TestWebKitAPI/Tests/WebKitCocoa/WKHTTPCookieStore.mm

* Source/WebKit/UIProcess/API/Cocoa/WKHTTPCookieStore.h:
* Source/WebKit/UIProcess/API/Cocoa/WKHTTPCookieStore.mm:
(-[WKHTTPCookieStore getCookiesForURL:completionHandler:]):
(-[WKHTTPCookieStore _getCookiesForURL:completionHandler:]):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/InAppBrowserPrivacy.mm:
(TEST(InAppBrowserPrivacy, GetCookieForURLFails)):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/WKHTTPCookieStore.mm:
(TEST(WKHTTPCookieStore, CookiesForURL)):

Canonical link: https://commits.webkit.org/307189@main
@webkit-commit-queue webkit-commit-queue force-pushed the eng/Add-WKHTTPCookieStore-getCookiesForURL-API branch from a71d7a7 to 7475a7e Compare February 10, 2026 18:58
@webkit-commit-queue
Copy link
Collaborator

Committed 307189@main (7475a7e): https://commits.webkit.org/307189@main

Reviewed commits have been landed. Closing PR #57975 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit 7475a7e into WebKit:main Feb 10, 2026
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Feb 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants