1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 04:37:34 +00:00

WebContent: Create a separate realm for JS console input

This allows us to expose extra functions and properties to the console,
such as `$0`, without them being available to website scripts.

`ConsoleEnvironmentSettingsObject` is basically a stub, since we require
an `EnvironmentSettingsObject` but it has abstract methods.
This commit is contained in:
Sam Atkins 2022-11-19 16:12:19 +00:00 committed by Linus Groh
parent 9782660cb6
commit f9c9506997
2 changed files with 41 additions and 12 deletions

View file

@ -1,7 +1,7 @@
/*
* Copyright (c) 2021, Brandon Scott <xeon.productions@gmail.com>
* Copyright (c) 2020, Hunter Salyer <thefalsehonesty@gmail.com>
* Copyright (c) 2021, Sam Atkins <atkinssj@serenityos.org>
* Copyright (c) 2021-2022, Sam Atkins <atkinssj@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@ -36,6 +36,7 @@ private:
ConnectionFromClient& m_client;
WeakPtr<JS::Realm> m_realm;
JS::GCPtr<class ConsoleEnvironmentSettingsObject> m_console_settings;
JS::Handle<ConsoleGlobalObject> m_console_global_object;
void clear_output();