[webkit-changes] [WebKit/WebKit] 36c6dd: Safari is hanging on launch in WebExtension::resou...

Timothy Hatcher noreply at github.com
Fri Feb 23 00:41:40 PST 2024


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

  Changed paths:
    M Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionActionCocoa.mm
    M Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionCocoa.mm

  Log Message:
  -----------
  Safari is hanging on launch in WebExtension::resourceFileURLForPath.
https://webkit.org/b/269972
rdar://123470286

Reviewed by Brian Weinstein.

Three things were happening here to cause the hang:

* The incorrect logic for checking null strings in `clearCustomizations()` was causing the
notification to fire all the time. When the action cleared, Ghostery would set custom icons
and an empty badge string again (likely detecting the change in results from browser.action
APIs.) This would cause rapid cycles of change and reset.

* The icon paths Ghostery uses start with a `/`. This was causing our `resourceFileURLForPath()`
function to truncate the file URL back to the root and return nil for the icons path. This caused
the action icon image to fail to load and show a blank icon.

* Not all of the action properties were properly tracking changes, always sending the changed
notification when nothing had changed.

* Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionActionCocoa.mm:
(WebKit::WebExtensionAction::clearCustomizations): Correct the null string checks.
(WebKit::WebExtensionAction::setIconsDictionary): Early return if nothing changed.
(WebKit::WebExtensionAction::setHasUnreadBadgeText): Ditto.
(WebKit::WebExtensionAction::incrementBlockedResourceCount): Ditto.
* Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionCocoa.mm:
(WebKit::WebExtension::resourceFileURLForPath): Remove prefix if present.

Canonical link: https://commits.webkit.org/275225@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