diff --git a/Base/res/ladybird/about.html b/Base/res/ladybird/about.html new file mode 100644 index 0000000000..ec6143133c --- /dev/null +++ b/Base/res/ladybird/about.html @@ -0,0 +1,14 @@ + + + + + About URLs + + +

List of About URLs

+ + + diff --git a/Meta/gn/secondary/Ladybird/BUILD.gn b/Meta/gn/secondary/Ladybird/BUILD.gn index c7c35bd914..4f0378a044 100644 --- a/Meta/gn/secondary/Ladybird/BUILD.gn +++ b/Meta/gn/secondary/Ladybird/BUILD.gn @@ -294,6 +294,7 @@ if (current_os == "mac") { bundle_data("ladybird_web_resources") { sources = [ + "//Base/res/ladybird/about.html", "//Base/res/ladybird/inspector.css", "//Base/res/ladybird/inspector.js", "//Base/res/ladybird/newtab.html", diff --git a/Userland/Libraries/LibWeb/Fetch/Fetching/Fetching.cpp b/Userland/Libraries/LibWeb/Fetch/Fetching/Fetching.cpp index 32355f3bf6..df90ea6608 100644 --- a/Userland/Libraries/LibWeb/Fetch/Fetching/Fetching.cpp +++ b/Userland/Libraries/LibWeb/Fetch/Fetching/Fetching.cpp @@ -718,6 +718,9 @@ WebIDL::ExceptionOr> scheme_fetch(JS::Realm& r response->set_body(MUST(Infrastructure::byte_sequence_as_body(realm, ""sv.bytes()))); return PendingResponse::create(vm, request, response); } + + // FIXME: This is actually wrong, see note above. + return TRY(nonstandard_resource_loader_file_or_http_network_fetch(realm, fetch_params)); } // -> "blob" else if (request->current_url().scheme() == "blob"sv) { diff --git a/Userland/Libraries/LibWeb/Loader/ResourceLoader.cpp b/Userland/Libraries/LibWeb/Loader/ResourceLoader.cpp index d66f6c45bf..8290295ff5 100644 --- a/Userland/Libraries/LibWeb/Loader/ResourceLoader.cpp +++ b/Userland/Libraries/LibWeb/Loader/ResourceLoader.cpp @@ -230,6 +230,14 @@ void ResourceLoader::load(LoadRequest& request, SuccessCallback success_callback HashMap response_headers; response_headers.set("Content-Type", "text/html; charset=UTF-8"); + // Other about static HTML pages + auto resource = Core::Resource::load_from_uri(MUST(String::formatted("resource://ladybird/{}.html", url.path_segment_at_index(0)))); + if (!resource.is_error()) { + auto data = resource.value()->data(); + success_callback(data, response_headers, {}); + return; + } + Platform::EventLoopPlugin::the().deferred_invoke([success_callback = move(success_callback), response_headers = move(response_headers)] { success_callback(ByteString::empty().to_byte_buffer(), response_headers, {}); });