mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 23:24:57 +00:00
LibWeb: Add 'is scripting enabled' concept to EnvironmentSettingsObject
This is now the source of truth for 'user enabled/disabled scripting', but it has to ask the window's page, which actually stores the setting. Also use this new functionality in two places where it was previously marked as a FIXME.
This commit is contained in:
parent
f60a2a1d80
commit
7bdbac7fd9
6 changed files with 42 additions and 4 deletions
|
@ -24,7 +24,9 @@ NonnullRefPtr<ClassicScript> ClassicScript::create(String filename, StringView s
|
|||
if (muted_errors == MutedErrors::Yes)
|
||||
base_url = "about:blank";
|
||||
|
||||
// FIXME: 3. If scripting is disabled for settings, then set source to the empty string.
|
||||
// 3. If scripting is disabled for settings, then set source to the empty string.
|
||||
if (environment_settings_object.is_scripting_disabled())
|
||||
source = "";
|
||||
|
||||
// 4. Let script be a new classic script that this algorithm will subsequently initialize.
|
||||
auto script = adopt_ref(*new ClassicScript(move(base_url), move(filename), environment_settings_object));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue