mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 18:20:43 +09:00
LibWeb+WebContent: Set ConsoleClient for nested browsing contexts
Before page_did_create_main_document() only initialized ConsoleClient for top-level browsing context which means that nested browsing context could not print into the console. With this change, ConsoleClient is initialized for documents created for nested browsing context too. One ConsoleClient is shared between all browsing contexts within the same page.
This commit is contained in:
parent
490949c6a8
commit
b4fe118dff
Notes:
sideshowbarker
2024-07-17 03:18:29 +09:00
Author: https://github.com/kalenikaliaksandr
Commit: b4fe118dff
Pull-request: https://github.com/SerenityOS/serenity/pull/20979
Reviewed-by: https://github.com/ADKaster ✅
6 changed files with 10 additions and 10 deletions
|
@ -601,16 +601,16 @@ Messages::WebContentServer::GetHoveredNodeIdResponse ConnectionFromClient::get_h
|
|||
return (i32)0;
|
||||
}
|
||||
|
||||
void ConnectionFromClient::initialize_js_console(Badge<PageHost>)
|
||||
void ConnectionFromClient::initialize_js_console(Badge<PageHost>, Web::DOM::Document& document)
|
||||
{
|
||||
auto* document = page().top_level_browsing_context().active_document();
|
||||
auto realm = document->realm().make_weak_ptr();
|
||||
auto realm = document.realm().make_weak_ptr();
|
||||
if (m_realm.ptr() == realm.ptr())
|
||||
return;
|
||||
|
||||
auto console_object = realm->intrinsics().console_object();
|
||||
m_realm = realm;
|
||||
m_console_client = make<WebContentConsoleClient>(console_object->console(), *m_realm, *this);
|
||||
if (!m_console_client)
|
||||
m_console_client = make<WebContentConsoleClient>(console_object->console(), *m_realm, *this);
|
||||
console_object->console().set_client(*m_console_client.ptr());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue