1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 09:38:11 +00:00
serenity/Userland/Libraries/LibWeb/Internals/Inspector.h
Timothy Flynn 9f374a5d2a LibWeb+LibWebView+WebContent: Add an Inspector IPC to execute JavaScript
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.
2023-12-02 10:34:22 +01:00

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;
};
}