Skip to content
Permalink
Browse files
Clicking a link to a download file served by a service-worker with a …
…fetch event handler yields "Frame load interrupted" error

https://bugs.webkit.org/show_bug.cgi?id=247793
rdar://problem/102296700

Web Inspector shows the "Frame load interrupted" error based on the sub resource load failing error.
Mark the error type as Cancellation so that Web Inspector does not show this message.

Reviewed by Alex Christensen.

* Source/WebCore/loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::interruptedForPolicyChangeError const):
(WebCore::DocumentLoader::stopLoadingForPolicyChange):

Canonical link: https://commits.webkit.org/256725@main
  • Loading branch information
youennf committed Nov 16, 2022
1 parent c135988 commit 30bd7667b181ed333be95ebfc8a24617c7ebaab6
Showing 1 changed file with 4 additions and 4 deletions.
@@ -1211,14 +1211,14 @@ ResourceError DocumentLoader::interruptedForPolicyChangeError() const
if (!frameLoader())
return {};

return frameLoader()->client().interruptedForPolicyChangeError(request());
auto error = frameLoader()->client().interruptedForPolicyChangeError(request());
error.setType(ResourceError::Type::Cancellation);
return error;
}

void DocumentLoader::stopLoadingForPolicyChange()
{
ResourceError error = interruptedForPolicyChangeError();
error.setType(ResourceError::Type::Cancellation);
cancelMainResourceLoad(error);
cancelMainResourceLoad(interruptedForPolicyChangeError());
}

#if ENABLE(SERVICE_WORKER)

0 comments on commit 30bd766

Please sign in to comment.