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): do not hang on close when there is a dialog (#4332)

Yury Semikhatsky890add98fe5f
diff --git a/browser_patches/webkit/BUILD_NUMBER b/browser_patches/webkit/BUILD_NUMBER
index b50ff03925..3b55e7c1d6 100644
--- a/browser_patches/webkit/BUILD_NUMBER
+++ b/browser_patches/webkit/BUILD_NUMBER
@@ -1,2 +1,2 @@
-1377
-Changed: [email protected] Tue 03 Nov 2020 03:59:48 PM PST
+1378
+Changed: [email protected] Tue Nov 3 18:28:54 PST 2020
diff --git a/browser_patches/webkit/embedder/Playwright/mac/AppDelegate.m b/browser_patches/webkit/embedder/Playwright/mac/AppDelegate.m
index 45d2309b76..682d78e29a 100644
--- a/browser_patches/webkit/embedder/Playwright/mac/AppDelegate.m
+++ b/browser_patches/webkit/embedder/Playwright/mac/AppDelegate.m
@@ -358,6 +358,7 @@ const NSActivityOptions ActivityOptions =
#pragma mark WKUIDelegate
- (void)webViewDidClose:(WKWebView *)webView {
+ [self webView:webView handleJavaScriptDialog:false value:nil];
for (NSWindow *window in _headlessWindows) {
if (webView.window != window)
continue;
diff --git a/browser_patches/webkit/embedder/Playwright/mac/BrowserWindowController.m b/browser_patches/webkit/embedder/Playwright/mac/BrowserWindowController.m
index ca160302b8..4856e09e28 100644
--- a/browser_patches/webkit/embedder/Playwright/mac/BrowserWindowController.m
+++ b/browser_patches/webkit/embedder/Playwright/mac/BrowserWindowController.m
@@ -418,6 +418,7 @@ static BOOL areEssentiallyEqual(double a, double b)
}
- (void)webViewDidClose:(WKWebView *)webView {
+ [self webView:webView handleJavaScriptDialog:false value:nil];
[self.window close];
}