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

LibWeb+WebContent: Add option to dump session history of a traversable

This commit is contained in:
Aliaksandr Kalenik 2023-08-14 20:19:41 +02:00 committed by Andreas Kling
parent 537bf4c917
commit aef4b84e22
4 changed files with 37 additions and 0 deletions

View file

@ -26,6 +26,7 @@
#include <LibWeb/HTML/BrowsingContext.h>
#include <LibWeb/HTML/Scripting/ClassicScript.h>
#include <LibWeb/HTML/Storage.h>
#include <LibWeb/HTML/TraversableNavigable.h>
#include <LibWeb/HTML/Window.h>
#include <LibWeb/Layout/Viewport.h>
#include <LibWeb/Loader/ContentFilter.h>
@ -359,6 +360,11 @@ void ConnectionFromClient::report_finished_handling_input_event(bool event_was_h
void ConnectionFromClient::debug_request(DeprecatedString const& request, DeprecatedString const& argument)
{
if (request == "dump-session-history") {
auto const& traversable = page().top_level_traversable();
Web::dump_tree(*traversable);
}
if (request == "dump-dom-tree") {
if (auto* doc = page().top_level_browsing_context().active_document())
Web::dump_tree(*doc);