1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 07:47:35 +00:00

LibWeb+WebContent: Create WebContentConsoleClient for every document

Fixes regression introduced in b4fe118dff

The `WebContentConsoleClient` needs to be created not just once, but
for every new document. Although the JS Console window allows
communication only with the active document associated with the
top-level browsing context, we still need a console client for each
iframe's document to ensure their console logs are printed.

In the future, we might consider adding the ability to switch which
document the JS Console window communicates with.

Fixes https://github.com/SerenityOS/serenity/issues/21117
This commit is contained in:
Aliaksandr Kalenik 2023-09-17 16:11:16 +02:00 committed by Andreas Kling
parent 9a61041941
commit a76ef04ae6
7 changed files with 34 additions and 15 deletions

View file

@ -94,6 +94,7 @@ private:
virtual void page_did_request_media_context_menu(Web::CSSPixelPoint, DeprecatedString const& target, unsigned modifiers, Web::Page::MediaContextMenu) override;
virtual void page_did_start_loading(const URL&, bool) override;
virtual void page_did_create_new_document(Web::DOM::Document&) override;
virtual void page_did_destroy_document(Web::DOM::Document&) override;
virtual void page_did_finish_loading(const URL&) override;
virtual void page_did_request_alert(String const&) override;
virtual void page_did_request_confirm(String const&) override;