mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 13:49:16 +00:00
WebContent: Do not create JS consoles for fragment-parsing documents
There's no need to go through this setup.
This commit is contained in:
parent
c838ca78c8
commit
a1c57ed79a
Notes:
github-actions[bot]
2024-08-01 09:36:51 +00:00
Author: https://github.com/trflynn89
Commit: a1c57ed79a
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/916
1 changed files with 5 additions and 2 deletions
|
@ -342,8 +342,8 @@ void PageClient::page_did_create_new_document(Web::DOM::Document& document)
|
||||||
|
|
||||||
void PageClient::page_did_change_active_document_in_top_level_browsing_context(Web::DOM::Document& document)
|
void PageClient::page_did_change_active_document_in_top_level_browsing_context(Web::DOM::Document& document)
|
||||||
{
|
{
|
||||||
VERIFY(m_console_clients.contains(document));
|
if (auto console_client = m_console_clients.get(document); console_client.has_value())
|
||||||
m_top_level_document_console_client = *m_console_clients.get(document).value();
|
m_top_level_document_console_client = *console_client.value();
|
||||||
}
|
}
|
||||||
|
|
||||||
void PageClient::page_did_destroy_document(Web::DOM::Document& document)
|
void PageClient::page_did_destroy_document(Web::DOM::Document& document)
|
||||||
|
@ -663,6 +663,9 @@ ErrorOr<void> PageClient::connect_to_webdriver(ByteString const& webdriver_ipc_p
|
||||||
|
|
||||||
void PageClient::initialize_js_console(Web::DOM::Document& document)
|
void PageClient::initialize_js_console(Web::DOM::Document& document)
|
||||||
{
|
{
|
||||||
|
if (document.is_temporary_document_for_fragment_parsing())
|
||||||
|
return;
|
||||||
|
|
||||||
auto& realm = document.realm();
|
auto& realm = document.realm();
|
||||||
auto console_object = realm.intrinsics().console_object();
|
auto console_object = realm.intrinsics().console_object();
|
||||||
auto console_client = heap().allocate_without_realm<WebContentConsoleClient>(console_object->console(), document.realm(), *this);
|
auto console_client = heap().allocate_without_realm<WebContentConsoleClient>(console_object->console(), document.realm(), *this);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue