LibDevTools: Implement enough of the protocol to see a tab list

Previously, we could connect to our DevTools server from Firefox, but
could not see any information on Ladybird's opened tabs. This implements
enough of the protocol to see a tab list, but we cannot yet inspect the
tabs.
This commit is contained in:
Timothy Flynn 2025-02-15 07:53:57 -05:00 committed by Tim Flynn
commit b974e91731
Notes: github-actions[bot] 2025-02-19 13:47:18 +00:00
9 changed files with 168 additions and 2 deletions

View file

@ -13,6 +13,7 @@
#include <LibDevTools/Actors/DeviceActor.h>
#include <LibDevTools/Actors/PreferenceActor.h>
#include <LibDevTools/Actors/ProcessActor.h>
#include <LibDevTools/Actors/TabActor.h>
#include <LibDevTools/Connection.h>
#include <LibDevTools/DevToolsServer.h>
@ -43,6 +44,18 @@ DevToolsServer::DevToolsServer(DevToolsDelegate& delegate, NonnullRefPtr<Core::T
DevToolsServer::~DevToolsServer() = default;
void DevToolsServer::refresh_tab_list()
{
if (!m_root_actor)
return;
m_actor_registry.remove_all_matching([](auto const&, auto const& actor) {
return is<TabActor>(*actor);
});
m_root_actor->send_tab_list_changed_message();
}
ErrorOr<void> DevToolsServer::on_new_client()
{
if (m_connection)