Skip to content

Commit

Permalink
Crash at WebKit::WebExtensionContext::extensionCanAccessWebPage
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=268837
rdar://122396440

Reviewed by Brian Weinstein.

As seen in https://webkit.org/b/268767, it's likely that the page is being deallocated
and closed by the time the callback for storage is called and so the tab for the page is
not found. Instead of calling the RELEASE_ASSERT_NOT_REACHED() if the extension doesn't
have access to the tab, return false and just log an error.

Add an ASSERT_NOT_REACHED() so we can at least keep track of how often this case is hit.

* Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionContextCocoa.mm:
(WebKit::WebExtensionContext::extensionCanAccessWebPage):

Canonical link: https://commits.webkit.org/274161@main
  • Loading branch information
kiaraarose committed Feb 6, 2024
1 parent df707c1 commit 6ada695
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,9 @@ static _WKWebExtensionContextError toAPI(WebExtensionContext::Error error)
return true;

RELEASE_LOG_ERROR(Extensions, "Access to this tab is not allowed for this extension");
RELEASE_ASSERT_NOT_REACHED();

ASSERT_NOT_REACHED();
return false;
}

void WebExtensionContext::setUniqueIdentifier(String&& uniqueIdentifier)
Expand Down

0 comments on commit 6ada695

Please sign in to comment.