Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

browser(webkit): separate local storage dirs for different contexts (#13436)

Yury Semikhatsky43bf6df2bb36
diff --git a/browser_patches/webkit/BUILD_NUMBER b/browser_patches/webkit/BUILD_NUMBER
index 5057df1949..c17fb8c93d 100644
--- a/browser_patches/webkit/BUILD_NUMBER
+++ b/browser_patches/webkit/BUILD_NUMBER
@@ -1,2 +1,2 @@
-1629
-Changed: [email protected] Thu Apr 7 19:06:52 CEST 2022
+1630
+Changed: [email protected] Fri 08 Apr 2022 01:14:10 PM PDT
diff --git a/browser_patches/webkit/embedder/Playwright/mac/AppDelegate.m b/browser_patches/webkit/embedder/Playwright/mac/AppDelegate.m
index 171c3093b8..d4ec183fb2 100644
--- a/browser_patches/webkit/embedder/Playwright/mac/AppDelegate.m
+++ b/browser_patches/webkit/embedder/Playwright/mac/AppDelegate.m
@@ -179,6 +179,9 @@ const NSActivityOptions ActivityOptions =
if (!dataStore) {
_WKWebsiteDataStoreConfiguration *configuration = [[[_WKWebsiteDataStoreConfiguration alloc] init] autorelease];
if (_userDataDir) {
+ // Local storage state should be stored in separate dirs for persistent contexts.
+ [configuration setShouldUseCustomStoragePaths:YES];
+
NSURL *cookieFile = [NSURL fileURLWithPath:[NSString stringWithFormat:@"%@/cookie.db", _userDataDir]];
[configuration _setCookieStorageFile:cookieFile];