mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 09:38:11 +00:00

The Inspector will have an <input> element to execute user-provided JS. This adds an IDL method and IPC to forward that JS from the Inspector WebView to the Inspector client.
32 lines
693 B
C++
32 lines
693 B
C++
/*
|
|
* Copyright (c) 2023, Tim Flynn <trflynn89@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LibJS/Forward.h>
|
|
#include <LibWeb/Bindings/PlatformObject.h>
|
|
|
|
namespace Web::Internals {
|
|
|
|
class Inspector final : public Bindings::PlatformObject {
|
|
WEB_PLATFORM_OBJECT(Inspector, Bindings::PlatformObject);
|
|
JS_DECLARE_ALLOCATOR(Inspector);
|
|
|
|
public:
|
|
virtual ~Inspector() override;
|
|
|
|
void inspector_loaded();
|
|
void inspect_dom_node(i32 node_id, Optional<i32> const& pseudo_element);
|
|
|
|
void execute_console_script(String const& script);
|
|
|
|
private:
|
|
explicit Inspector(JS::Realm&);
|
|
|
|
virtual void initialize(JS::Realm&) override;
|
|
};
|
|
|
|
}
|