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

Browser+LibWeb+WebContent: Add ability to inspect local storage

The storage inspector now has a new tab for local storage. The next step
would be to persist local storage and receive real-time notifications
for changes to update the table view.
This commit is contained in:
Valtteri Koskivuori 2022-04-02 00:14:04 +03:00 committed by Linus Groh
parent f2b4c044db
commit 45a81f5a2c
14 changed files with 168 additions and 4 deletions

View file

@ -468,4 +468,10 @@ void ConnectionFromClient::set_is_scripting_enabled(bool is_scripting_enabled)
m_page_host->set_is_scripting_enabled(is_scripting_enabled);
}
Messages::WebContentServer::GetLocalStorageEntriesResponse ConnectionFromClient::get_local_storage_entries()
{
auto* document = page().top_level_browsing_context().active_document();
auto local_storage = document->window().local_storage();
return local_storage->map();
}
}

View file

@ -67,6 +67,8 @@ private:
virtual void run_javascript(String const&) override;
virtual void js_console_request_messages(i32) override;
virtual Messages::WebContentServer::GetLocalStorageEntriesResponse get_local_storage_entries() override;
virtual Messages::WebContentServer::GetSelectedTextResponse get_selected_text() override;
virtual void select_all() override;

View file

@ -47,4 +47,6 @@ endpoint WebContentServer
set_has_focus(bool has_focus) =|
set_is_scripting_enabled(bool is_scripting_enabled) =|
get_local_storage_entries() => (OrderedHashMap<String,String> entries)
}