Files
ladybird/Libraries/LibDevTools/Actors/TabActor.h
Andreas Kling 9b8e822390 LibDevTools: Send navigation events to Firefox DevTools
When a page navigates, send document-event resources with
"will-navigate" and tabNavigated messages so Firefox DevTools
can follow along and clear the Network panel appropriately.
2026-01-15 20:10:19 +01:00

47 lines
1.0 KiB
C++

/*
* Copyright (c) 2025, Tim Flynn <trflynn89@ladybird.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/NonnullRefPtr.h>
#include <AK/String.h>
#include <LibDevTools/Actor.h>
#include <LibDevTools/Forward.h>
namespace DevTools {
struct TabDescription {
u64 id { 0 };
String title;
String url;
};
class DEVTOOLS_API TabActor final : public Actor {
public:
static constexpr auto base_name = "tab"sv;
static NonnullRefPtr<TabActor> create(DevToolsServer&, String name, TabDescription);
virtual ~TabActor() override;
TabDescription const& description() const { return m_description; }
JsonObject serialize_description() const;
void set_url(String url) { m_description.url = move(url); }
void set_title(String title) { m_description.title = move(title); }
void reset_selected_node();
private:
TabActor(DevToolsServer&, String name, TabDescription);
virtual void handle_message(Message const&) override;
TabDescription m_description;
WeakPtr<WatcherActor> m_watcher;
};
}