LibWeb/HTML: Do not disable scripting for script based about: pages

This commit is contained in:
Shannon Booth
2026-01-17 12:09:10 +01:00
committed by Tim Ledbetter
parent c505240401
commit 8eec7d4585
Notes: github-actions[bot] 2026-01-17 11:52:19 +00:00

View File

@@ -298,7 +298,11 @@ bool is_scripting_enabled(JS::Realm const& realm)
// The user has not disabled scripting for realm at this time. (User agents may provide users with the option to disable scripting globally, or in a finer-grained manner, e.g., on a per-origin basis, down to the level of individual realms.)
auto const& document = as<HTML::Window>(realm.global_object()).associated_document();
if (!document.page().is_scripting_enabled())
// NB: about:settings and about:processes are internal pages using javascript, so we do not consider user configuration for these pages.
if (document.url() != URL::about_settings()
&& document.url() != URL::about_processes()
&& !document.page().is_scripting_enabled())
return false;
// Either settings's global object is not a Window object, or settings's global object's associated Document's active sandboxing flag set does not have its sandboxed scripts browsing context flag set.