1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 22:07:35 +00:00

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! :^)
This commit is contained in:
Sam Atkins 2021-09-03 10:22:47 +01:00 committed by Andreas Kling
parent 7838eab341
commit 5220d6d2e5
2 changed files with 35 additions and 0 deletions

View file

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