[webkit-changes] [WebKit/WebKit] d2091f: Web Extension popup can present too soon.

Timothy Hatcher noreply at github.com
Wed Feb 28 09:41:24 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: d2091f38fe857c747e7eb84f0e2d7fe19aa6fd1c
      https://github.com/WebKit/WebKit/commit/d2091f38fe857c747e7eb84f0e2d7fe19aa6fd1c
  Author: Timothy Hatcher <timothy at apple.com>
  Date:   2024-02-28 (Wed, 28 Feb 2024)

  Changed paths:
    M Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionActionCocoa.mm
    M Source/WebKit/UIProcess/Extensions/WebExtensionAction.h
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebExtensionAPIAction.mm

  Log Message:
  -----------
  Web Extension popup can present too soon.
https://webkit.org/b/270185
rdar://problem/123711867

Reviewed by Brian Weinstein.

Instead of starting the timer that presented the popup on the start of the load,
we should start it after the document has loaded and rendering will begin.

This prevents us from showing the popup while it might still be loading, and
causing it to resize mid-animation in most instances.

Also connect delegate methods for load fails to close the popup, so the web view
doesn't stick around indefinitely. Some API tests were failing to load because the
popup.html resource was missing.

* Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionActionCocoa.mm:
(-[_WKWebExtensionActionWebViewDelegate webView:didFailProvisionalNavigation:withError:]):
(-[_WKWebExtensionActionWebViewDelegate webView:didFailNavigation:withError:]):
(-[_WKWebExtensionActionWebViewDelegate _webView:navigationDidFinishDocumentLoad:]):
(WebKit::WebExtensionAction::presentPopupWhenReady):
(WebKit::WebExtensionAction::popupDidFinishDocumentLoad):
(WebKit::WebExtensionAction::readyToPresentPopup):
* Source/WebKit/UIProcess/Extensions/WebExtensionAction.h:
* Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebExtensionAPIAction.mm:
(TestWebKitAPI::TEST):

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



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list