Bug 576479

Summary: [Browser] requesting new API like getAllCookies(url)
Product: [Eclipse Project] Platform Reporter: u74a8 zhou <1571224208>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3    
Version: 4.21   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description u74a8 zhou CLA 2021-10-06 12:26:03 EDT
We already have getCookie(name, url), but sometimes it might be convenient to get all cookies associated with an URL, maybe as a Map<String,String>.

For example, when using Jsoup we might simply do this:

Jsoup.connect(url).cookies(Browser.getAllCookies(url)).get();

I notice that in some backends the NativeGetCookie at some point already gets things like allCookies or cookiesList, so I consider this work won't be too difficult?

Refs:
https://git.eclipse.org/c/gerrit/platform/eclipse.platform.swt.git/tree/bundles/org.eclipse.swt/Eclipse%20SWT%20WebKit/cocoa/org/eclipse/swt/browser/WebKit.java?id=85ed0e18e536dc3a79d1dabe1ef4e0fdb5581dd4#n89
https://git.eclipse.org/c/gerrit/platform/eclipse.platform.swt.git/tree/bundles/org.eclipse.swt/Eclipse%20SWT%20Browser/win32/org/eclipse/swt/browser/IE.java?id=85ed0e18e536dc3a79d1dabe1ef4e0fdb5581dd4#n166
https://git.eclipse.org/c/gerrit/platform/eclipse.platform.swt.git/tree/bundles/org.eclipse.swt/Eclipse%20SWT%20Browser/win32/org/eclipse/swt/browser/Edge.java?id=85ed0e18e536dc3a79d1dabe1ef4e0fdb5581dd4#n102