mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 02:37:42 +00:00
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.
This commit is contained in:
parent
446a10a1ac
commit
4912b22e3b
6 changed files with 15 additions and 3 deletions
|
@ -187,11 +187,13 @@ void PageHost::page_did_start_loading(const URL& url)
|
|||
m_client.async_did_start_loading(url);
|
||||
}
|
||||
|
||||
void PageHost::page_did_create_main_document()
|
||||
{
|
||||
m_client.initialize_js_console({});
|
||||
}
|
||||
|
||||
void PageHost::page_did_finish_loading(const URL& url)
|
||||
{
|
||||
// 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({});
|
||||
m_client.async_did_finish_loading(url);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue