Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: b13fdff460899ae570ca67add0a3a93cd0df36c2
      
https://github.com/WebKit/WebKit/commit/b13fdff460899ae570ca67add0a3a93cd0df36c2
  Author: Timothy Hatcher <[email protected]>
  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@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
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to