Skip to content

Commit

Permalink
Blob url downloads fail when triggered from webextension
Browse files Browse the repository at this point in the history
rdar://78929424
https://bugs.webkit.org/show_bug.cgi?id=226440

Reviewed by Timothy Hatcher.

Web Extensions can have anchor tags to blobs with download attributes
that are expected to download, but are prevented by isUnsupportedWebExtensionNavigation.

isUnsupportedWebExtensionNavigation is about preventing navigations away from extensions,
but downloads do not cause the page to navigate away. Therefore adding a case for downloads
here should be okay.

* Source/WebKit/UIProcess/Cocoa/NavigationState.mm:
(WebKit::isUnsupportedWebExtensionNavigation):

Canonical link: https://commits.webkit.org/283220@main
  • Loading branch information
Pascoe committed Sep 5, 2024
1 parent ad1823e commit 61868ae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Source/WebKit/UIProcess/Cocoa/NavigationState.mm
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ static bool isUnsupportedWebExtensionNavigation(API::NavigationAction& navigatio
return false;

auto *requiredBaseURL = page.cocoaView().get()._requiredWebExtensionBaseURL;
if (!requiredBaseURL)
if (!requiredBaseURL || navigationAction.shouldPerformDownload())
return false;

if (RefPtr extensionController = page.webExtensionController()) {
Expand Down

0 comments on commit 61868ae

Please sign in to comment.