Skip to content

Commit

Permalink
Revert "WebContent: Limit the Console client to the top-level navigable"
Browse files Browse the repository at this point in the history
This reverts commit 758f488.

This commit was causing ASAN to complain about a use-after-poison, see
LadybirdBrowser#809
  • Loading branch information
AtkinsSJ committed Jul 24, 2024
1 parent 6ae9b54 commit 6d79995
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions Userland/Services/WebContent/PageClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -342,13 +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)
{
auto& realm = document.realm();

VERIFY(m_console_clients.contains(document));
m_top_level_document_console_client = *m_console_clients.get(document).value();

auto console_object = realm.intrinsics().console_object();
console_object->console().set_client(*m_top_level_document_console_client);
}

void PageClient::page_did_destroy_document(Web::DOM::Document& document)
Expand Down Expand Up @@ -671,6 +666,7 @@ void PageClient::initialize_js_console(Web::DOM::Document& document)
auto& realm = document.realm();
auto console_object = realm.intrinsics().console_object();
auto console_client = heap().allocate_without_realm<WebContentConsoleClient>(console_object->console(), document.realm(), *this);
console_object->console().set_client(*console_client);

m_console_clients.set(document, console_client);
}
Expand Down

0 comments on commit 6d79995

Please sign in to comment.