summaryrefslogtreecommitdiff
path: root/Userland/Services/WebContent/PageHost.cpp
diff options
context:
space:
mode:
authordavidot <davidot@serenityos.org>2022-09-21 17:12:00 +0200
committerLinus Groh <mail@linusgroh.de>2022-09-21 17:34:32 +0100
commit4912b22e3ba4b8aa5bf9cc6a8b41dda39cf44b48 (patch)
treee08683eda0589f66e620e1c0594eed55c2f6bdb6 /Userland/Services/WebContent/PageHost.cpp
parent446a10a1acaf5310125c06979acd41973f52e8d9 (diff)
downloadserenity-4912b22e3ba4b8aa5bf9cc6a8b41dda39cf44b48.zip
LibWeb+WebContent: Setup the js console client earlier
This allows us to print messages in inline scripts. Also add an example of this in the welcome page to test this.
Diffstat (limited to 'Userland/Services/WebContent/PageHost.cpp')
-rw-r--r--Userland/Services/WebContent/PageHost.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/Userland/Services/WebContent/PageHost.cpp b/Userland/Services/WebContent/PageHost.cpp
index 883c5fa43a..dc1ee8c04e 100644
--- a/Userland/Services/WebContent/PageHost.cpp
+++ b/Userland/Services/WebContent/PageHost.cpp
@@ -187,11 +187,13 @@ void PageHost::page_did_start_loading(const URL& url)
m_client.async_did_start_loading(url);
}
-void PageHost::page_did_finish_loading(const URL& url)
+void PageHost::page_did_create_main_document()
{
- // FIXME: This is called after the page has finished loading, which means any log messages
- // that happen *while* it is loading (such as inline <script>s) will be lost.
m_client.initialize_js_console({});
+}
+
+void PageHost::page_did_finish_loading(const URL& url)
+{
m_client.async_did_finish_loading(url);
}