mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-03 16:16:43 +00:00
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:
parent
58bc44ba2a
commit
b974e91731
Notes:
github-actions[bot]
2025-02-19 13:47:18 +00:00
Author: https://github.com/trflynn89
Commit: b974e91731
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3589
Reviewed-by: https://github.com/ADKaster
9 changed files with 168 additions and 2 deletions
38
Libraries/LibDevTools/Actors/TabActor.h
Normal file
38
Libraries/LibDevTools/Actors/TabActor.h
Normal file
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* Copyright (c) 2025, Tim Flynn <trflynn89@ladybird.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/NonnullRefPtr.h>
|
||||
#include <LibDevTools/Actor.h>
|
||||
|
||||
namespace DevTools {
|
||||
|
||||
struct TabDescription {
|
||||
u64 id { 0 };
|
||||
ByteString title;
|
||||
ByteString url;
|
||||
};
|
||||
|
||||
class TabActor final : public Actor {
|
||||
public:
|
||||
static constexpr auto base_name = "tab"sv;
|
||||
|
||||
static NonnullRefPtr<TabActor> create(DevToolsServer&, ByteString name, TabDescription);
|
||||
virtual ~TabActor() override;
|
||||
|
||||
virtual void handle_message(StringView type, JsonObject const&) override;
|
||||
|
||||
TabDescription const& description() const { return m_description; }
|
||||
JsonObject serialize_description() const;
|
||||
|
||||
private:
|
||||
TabActor(DevToolsServer&, ByteString name, TabDescription);
|
||||
|
||||
TabDescription m_description;
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue