mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:27:35 +00:00
WebContent: Add $()
and $$()
functions to browser console
These are based on the ones in Firefox: `$(selector, element = document)`: Equivalent to `element.querySelector(selector)`. `$$(selector, element = document)`: Equivalent to `element.querySelectorAll(selector)`.
This commit is contained in:
parent
c793beb0cc
commit
4ad1695c78
2 changed files with 63 additions and 0 deletions
|
@ -42,6 +42,10 @@ private:
|
|||
JS_DECLARE_NATIVE_FUNCTION($0_getter);
|
||||
// $_, the value of the most recent expression entered into the console
|
||||
JS_DECLARE_NATIVE_FUNCTION($__getter);
|
||||
// $(selector, element), equivalent to `(element || document).querySelector(selector)`
|
||||
JS_DECLARE_NATIVE_FUNCTION($_function);
|
||||
// $$(selector, element), equivalent to `(element || document).querySelectorAll(selector)`
|
||||
JS_DECLARE_NATIVE_FUNCTION($$_function);
|
||||
|
||||
Web::HTML::Window* m_window_object;
|
||||
JS::Value m_most_recent_result { JS::js_undefined() };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue