diff options
author | Andreas Kling <kling@serenityos.org> | 2022-02-08 19:50:14 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-02-08 21:53:20 +0100 |
commit | 3f9fc0f6901f3145d58b0813c8dd022c2fc5a8c2 (patch) | |
tree | c41a8da747ee108b74eafb52bdf234c19f259769 /Userland/Services | |
parent | 47979996e832bdd05440c4a9437920863543441d (diff) | |
download | serenity-3f9fc0f6901f3145d58b0813c8dd022c2fc5a8c2.zip |
Browser+LibWeb: Add "Dump Local Storage" item to Browser's Debug menu
Diffstat (limited to 'Userland/Services')
-rw-r--r-- | Userland/Services/WebContent/ClientConnection.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Userland/Services/WebContent/ClientConnection.cpp b/Userland/Services/WebContent/ClientConnection.cpp index fcefebfbaf..a3789a8d4d 100644 --- a/Userland/Services/WebContent/ClientConnection.cpp +++ b/Userland/Services/WebContent/ClientConnection.cpp @@ -17,9 +17,11 @@ #include <LibWeb/Bindings/MainThreadVM.h> #include <LibWeb/Cookie/ParsedCookie.h> #include <LibWeb/DOM/Document.h> +#include <LibWeb/DOM/Window.h> #include <LibWeb/Dump.h> #include <LibWeb/HTML/BrowsingContext.h> #include <LibWeb/HTML/Scripting/ClassicScript.h> +#include <LibWeb/HTML/Storage.h> #include <LibWeb/Layout/InitialContainingBlock.h> #include <LibWeb/Loader/ContentFilter.h> #include <LibWeb/Loader/ResourceLoader.h> @@ -222,6 +224,11 @@ void ClientConnection::debug_request(const String& request, const String& argume if (request == "same-origin-policy") { m_page_host->page().set_same_origin_policy_enabled(argument == "on"); } + + if (request == "dump-local-storage") { + if (auto* doc = page().top_level_browsing_context().active_document()) + doc->window().local_storage()->dump(); + } } void ClientConnection::get_source() |