summaryrefslogtreecommitdiff
path: root/Libraries
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-05-10 11:13:36 +0200
committerAndreas Kling <kling@serenityos.org>2020-05-10 11:14:30 +0200
commitfe0de26277f66ef8c0abadf4ef5a01df4448a11c (patch)
treea6c366c54d18133992ac9ece85b37c80fcc1d97a /Libraries
parent56dbe58bbb97a0c7d5416ce16094ccbbf2efe0a6 (diff)
downloadserenity-fe0de26277f66ef8c0abadf4ef5a01df4448a11c.zip
LibWeb+Browser: Support about: URL protocol so "about:blank" works :^)
For now, we simply load an empty resource from any about: URL.
Diffstat (limited to 'Libraries')
-rw-r--r--Libraries/LibWeb/HtmlView.cpp2
-rw-r--r--Libraries/LibWeb/ResourceLoader.cpp8
2 files changed, 9 insertions, 1 deletions
diff --git a/Libraries/LibWeb/HtmlView.cpp b/Libraries/LibWeb/HtmlView.cpp
index 767b5be9c7..3354125b8a 100644
--- a/Libraries/LibWeb/HtmlView.cpp
+++ b/Libraries/LibWeb/HtmlView.cpp
@@ -413,7 +413,7 @@ void HtmlView::load(const URL& url)
load_error_page(url, error);
});
- if (url.protocol() != "file") {
+ if (url.protocol() != "file" && url.protocol() != "about") {
URL favicon_url;
favicon_url.set_protocol(url.protocol());
favicon_url.set_host(url.host());
diff --git a/Libraries/LibWeb/ResourceLoader.cpp b/Libraries/LibWeb/ResourceLoader.cpp
index 664fbdb050..f8d6be8b51 100644
--- a/Libraries/LibWeb/ResourceLoader.cpp
+++ b/Libraries/LibWeb/ResourceLoader.cpp
@@ -73,6 +73,14 @@ void ResourceLoader::load(const URL& url, Function<void(const ByteBuffer&, const
return;
}
+ if (url.protocol() == "about") {
+ dbg() << "Loading about: URL " << url;
+ deferred_invoke([success_callback = move(success_callback)](auto&) {
+ success_callback(ByteBuffer::wrap(String::empty().characters(), 1), {});
+ });
+ return;
+ }
+
if (url.protocol() == "data") {
dbg() << "ResourceLoader loading a data URL with mime-type: '" << url.data_mime_type() << "', base64=" << url.data_payload_is_base64() << ", payload='" << url.data_payload() << "'";