diff options
author | Sam Atkins <atkinssj@gmail.com> | 2021-09-03 10:16:36 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-09-06 18:20:26 +0200 |
commit | 7838eab34158bcb317fad5d00ae50691b0e9e02f (patch) | |
tree | fef1513c3b1346f47d8a58b38e80a6f1e57fafba /Userland/Services/WebContent/ClientConnection.h | |
parent | ca2c1299233678cb4fe7fcdb9ded21e8bdde5d0e (diff) | |
download | serenity-7838eab34158bcb317fad5d00ae50691b0e9e02f.zip |
WebContent: Implement ConsoleGlobalObject which proxies to WindowObject
ConsoleGlobalObject is used as the global object when running javascript
from the Browser console. This lets us implement console-only functions
and variables (like `$0`) without exposing them to webpage content. It
passes other calls over to the usual WindowObject so any code that would
have worked in the webpage will still work in the console. :^)
Diffstat (limited to 'Userland/Services/WebContent/ClientConnection.h')
-rw-r--r-- | Userland/Services/WebContent/ClientConnection.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Userland/Services/WebContent/ClientConnection.h b/Userland/Services/WebContent/ClientConnection.h index 8dba21858c..f4b6494048 100644 --- a/Userland/Services/WebContent/ClientConnection.h +++ b/Userland/Services/WebContent/ClientConnection.h @@ -9,6 +9,7 @@ #include <AK/HashMap.h> #include <LibIPC/ClientConnection.h> #include <LibJS/Forward.h> +#include <LibJS/Heap/Handle.h> #include <LibWeb/Cookie/ParsedCookie.h> #include <LibWeb/Forward.h> #include <WebContent/Forward.h> @@ -72,6 +73,7 @@ private: WeakPtr<JS::Interpreter> m_interpreter; OwnPtr<WebContentConsoleClient> m_console_client; + JS::Handle<JS::GlobalObject> m_console_global_object; }; } |