-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] browser.close does not resolve after right-click on Webkit headful #2700
Comments
aslushnikov
added a commit
to aslushnikov/playwright
that referenced
this issue
Jul 2, 2020
Currently, if web page has an open context menu, then it won't close. This prevents browser from quitting. In stock safari, this behavior can also be observed in a way that context menu will stay opened even if related page got closed. While investigating this behavior on Mac, a crucial observation was that `[NSMenu popUpContextMenu]` is spawning a nested event loop, keeping reference to `WebContextMenuProxyMac` instance, which in turn keeps references on associated `NSView` with `WKWebView`. To exit the loop, we need to explicitly cancel context menu. For this, this patch adds a method `hide` on `WebContextMenuProxy` that uses port-specific code to cancel context menu. Windows part of this patch is somewhat speculative: I didn't check it, but given the same symptomps, I applied the same solution. Fixes microsoft#2700
aslushnikov
added a commit
that referenced
this issue
Jul 2, 2020
) Review URL: aslushnikov/WebKit@42f86e9 Currently, if web page has an open context menu, then it won't close. This prevents browser from quitting. In stock safari, this behavior can also be observed in a way that context menu will stay opened even if related page got closed. While investigating this behavior on Mac, a crucial observation was that `[NSMenu popUpContextMenu]` is spawning a nested event loop, keeping reference to `WebContextMenuProxyMac` instance, which in turn keeps references on associated `NSView` with `WKWebView`. To exit the loop, we need to explicitly cancel context menu. For this, this patch adds a method `hide` on `WebContextMenuProxy` that uses port-specific code to cancel context menu. Windows part of this patch is somewhat speculative: I didn't check it, but given the same symptomps, I applied the same solution. Fixes #2700
Oops too early to close! This requires a test and a roll. |
Turns out Chromium is also susceptible to this! |
aslushnikov
added a commit
that referenced
this issue
Jul 2, 2020
aslushnikov
added a commit
to aslushnikov/playwright
that referenced
this issue
Jul 2, 2020
This was referenced Jul 2, 2020
aslushnikov
added a commit
to aslushnikov/playwright
that referenced
this issue
Jul 3, 2020
aslushnikov
added a commit
that referenced
this issue
Jul 3, 2020
Upstream chromium patch: https://chromium-review.googlesource.com/c/chromium/src/+/2285520 |
aslushnikov
added a commit
to aslushnikov/playwright
that referenced
this issue
Jul 8, 2020
This roll includes: - https://crrev.com/786119 - mac: close context menu when destroying RenderViewContextMenuMacCocoa Fixes microsoft#2700
aslushnikov
added a commit
that referenced
this issue
Jul 9, 2020
This roll includes: - https://crrev.com/786119 - mac: close context menu when destroying RenderViewContextMenuMacCocoa Fixes #2700
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Context:
Code Snippet
Similar to #2699. When running Webkit in headful mode, the browser.close does not resolve because it leaves a dangling context menu. Pressing escape or clicking on a menu item resolves browser.close.
The text was updated successfully, but these errors were encountered: