diff options
author | Sam Atkins <atkinssj@gmail.com> | 2021-09-03 10:22:47 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-09-06 18:20:26 +0200 |
commit | 5220d6d2e50ce9ab7e5238a080438dea5d3d6656 (patch) | |
tree | 972b1e6dfd46c98d673f265db3247a3c5c6cfc8a /Userland/Services/WebContent/ConsoleGlobalObject.h | |
parent | 7838eab34158bcb317fad5d00ae50691b0e9e02f (diff) | |
download | serenity-5220d6d2e50ce9ab7e5238a080438dea5d3d6656.zip |
WebContent: Implement `$0` special variable in Browser JS Console
`$0` is a helpful variable in other browsers' JS consoles, which points
to whichever DOM Node is currently selected in the DOM Inspector. And
now we have it too! :^)
Diffstat (limited to 'Userland/Services/WebContent/ConsoleGlobalObject.h')
-rw-r--r-- | Userland/Services/WebContent/ConsoleGlobalObject.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Userland/Services/WebContent/ConsoleGlobalObject.h b/Userland/Services/WebContent/ConsoleGlobalObject.h index 03ec211f84..3ef87afbf7 100644 --- a/Userland/Services/WebContent/ConsoleGlobalObject.h +++ b/Userland/Services/WebContent/ConsoleGlobalObject.h @@ -34,9 +34,14 @@ public: virtual bool internal_delete(JS::PropertyName const& name) override; virtual JS::MarkedValueList internal_own_property_keys() const override; + virtual void initialize_global_object() override; + private: virtual void visit_edges(Visitor&) override; + // Because $0 is not a nice C++ function name + JS_DECLARE_NATIVE_GETTER(inspected_node_getter); + Web::Bindings::WindowObject* m_window_object; }; |