1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-29 11:55:10 +00:00

LibWeb: Implement ad-hoc steps to allow LibWeb to load resource:// URLs

The resource:// scheme is used for Core::Resource files. Currently, any
users of resource:// URLs in Ladybird must manually create the Resource
and extract its data. This will allow for passing the resource:// URL
along for LibWeb to handle.
This commit is contained in:
Timothy Flynn 2023-12-23 15:42:05 -05:00 committed by Andreas Kling
parent 48f39f0555
commit e511a264fe
3 changed files with 40 additions and 8 deletions

View file

@ -832,6 +832,10 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<PendingResponse>> scheme_fetch(JS::Realm& r
// Return the result of running HTTP fetch given fetchParams.
return http_fetch(realm, fetch_params);
}
// AD-HOC: "resource"
else if (request->current_url().scheme() == "resource"sv) {
return TRY(nonstandard_resource_loader_file_or_http_network_fetch(realm, fetch_params));
}
// 4. Return a network error.
auto message = request->current_url().scheme() == "about"sv