[webkit-changes] [WebKit/WebKit] b13fdf: REGRESSION(285082 at main): Safari crashes on launch ...

Timothy Hatcher noreply at github.com
Mon Oct 14 16:28:30 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: b13fdff460899ae570ca67add0a3a93cd0df36c2
      https://github.com/WebKit/WebKit/commit/b13fdff460899ae570ca67add0a3a93cd0df36c2
  Author: Timothy Hatcher <timothy at apple.com>
  Date:   2024-10-14 (Mon, 14 Oct 2024)

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

  Log Message:
  -----------
  REGRESSION(285082 at main): Safari crashes on launch under WebExtension::WebExtension.
https://webkit.org/b/281453
rdar://137840714

Reviewed by Brian Weinstein.

Fix multiple issues causing extensions to fail loading or crash:

1. `resourceFileURLForPath()` was only resolving the real path for one URL, but wasn’t
comparing it against the real path of the base URL. On iOS, apps are installed in a
container under `/var`, which is a symlink to `/private/var`, causing mismatches between
the real and non-real paths.

2. When resolving the real path fails for a missing file, it returned the original
string, leading to prefix mismatches and unnecessary error logs. This is now handled
as a silent error, returning a null URL since the caller already records a “file not
found” error.

3. Errors were not being recorded properly due to incorrect handling of outError.
Checking for null is no longer valid now that outError is passed by reference.
This was effectively never returning an error since outError starts as null.

4. Ensure that an error is always recorded for an invalid manifest, even if the JSON
parser doesn’t return a specific parse error.

* Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionCocoa.mm:
(WebKit::WebExtension::parseManifest): Always record an error.
(WebKit::WebExtension::resourceDataForPath): Don't null check outError.
* Source/WebKit/UIProcess/Extensions/WebExtension.cpp:
(WebKit::WebExtension::resourceFileURLForPath): Correct logic and handle missing files.

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