mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 02:05:07 +02:00
LibWeb/HTML: Do not disable scripting for script based about: pages
This commit is contained in:
committed by
Tim Ledbetter
parent
c505240401
commit
8eec7d4585
Notes:
github-actions[bot]
2026-01-17 11:52:19 +00:00
Author: https://github.com/shannonbooth Commit: https://github.com/LadybirdBrowser/ladybird/commit/8eec7d4585c Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/7496 Reviewed-by: https://github.com/tcl3 ✅
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user