mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-06 17:48:37 +00:00
LibDevTools: Begin supporting the JavaScript console
This implements enough to execute JavaScript and reply with the result. We do not yet support autocomplete or eager evaluation.
This commit is contained in:
parent
37f07c176a
commit
6d33b70e61
Notes:
github-actions[bot]
2025-02-28 12:09:40 +00:00
Author: https://github.com/trflynn89
Commit: 6d33b70e61
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3686
8 changed files with 170 additions and 7 deletions
33
Libraries/LibDevTools/Actors/ConsoleActor.h
Normal file
33
Libraries/LibDevTools/Actors/ConsoleActor.h
Normal file
|
@ -0,0 +1,33 @@
|
|||
/*
|
||||
* 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 {
|
||||
|
||||
class ConsoleActor final : public Actor {
|
||||
public:
|
||||
static constexpr auto base_name = "console"sv;
|
||||
|
||||
static NonnullRefPtr<ConsoleActor> create(DevToolsServer&, String name, WeakPtr<TabActor>);
|
||||
virtual ~ConsoleActor() override;
|
||||
|
||||
virtual void handle_message(StringView type, JsonObject const&) override;
|
||||
|
||||
private:
|
||||
ConsoleActor(DevToolsServer&, String name, WeakPtr<TabActor>);
|
||||
|
||||
void received_console_result(String result_id, String input, JsonValue result, BlockToken);
|
||||
|
||||
WeakPtr<TabActor> m_tab;
|
||||
|
||||
u64 m_execution_id { 0 };
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue