summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2022-02-08 19:50:14 +0100
committerAndreas Kling <kling@serenityos.org>2022-02-08 21:53:20 +0100
commit3f9fc0f6901f3145d58b0813c8dd022c2fc5a8c2 (patch)
treec41a8da747ee108b74eafb52bdf234c19f259769 /Userland/Libraries/LibWeb
parent47979996e832bdd05440c4a9437920863543441d (diff)
downloadserenity-3f9fc0f6901f3145d58b0813c8dd022c2fc5a8c2.zip
Browser+LibWeb: Add "Dump Local Storage" item to Browser's Debug menu
Diffstat (limited to 'Userland/Libraries/LibWeb')
-rw-r--r--Userland/Libraries/LibWeb/HTML/Storage.cpp10
-rw-r--r--Userland/Libraries/LibWeb/HTML/Storage.h2
2 files changed, 12 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/Storage.cpp b/Userland/Libraries/LibWeb/HTML/Storage.cpp
index 533c95b928..f17b05bfb8 100644
--- a/Userland/Libraries/LibWeb/HTML/Storage.cpp
+++ b/Userland/Libraries/LibWeb/HTML/Storage.cpp
@@ -146,4 +146,14 @@ Vector<String> Storage::supported_property_names() const
return m_map.keys();
}
+void Storage::dump() const
+{
+ dbgln("Storage ({} key(s))", m_map.size());
+ size_t i = 0;
+ for (auto const& it : m_map) {
+ dbgln("[{}] \"{}\": \"{}\"", i, it.key, it.value);
+ ++i;
+ }
+}
+
}
diff --git a/Userland/Libraries/LibWeb/HTML/Storage.h b/Userland/Libraries/LibWeb/HTML/Storage.h
index d8cf2c63e7..091b2c0b75 100644
--- a/Userland/Libraries/LibWeb/HTML/Storage.h
+++ b/Userland/Libraries/LibWeb/HTML/Storage.h
@@ -32,6 +32,8 @@ public:
Vector<String> supported_property_names() const;
+ void dump() const;
+
private:
Storage();