mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-04 23:30:20 +00:00
LibWeb: Check if scripting is disabled before running script
This is not a full check, it's just enough to prevent script execution in DOMParser.
This commit is contained in:
parent
ce314c54bd
commit
0ea50d44bf
Notes:
sideshowbarker
2024-07-18 10:24:40 +09:00
Author: https://github.com/Lubrsi
Commit: 0ea50d44bf
Pull-request: https://github.com/SerenityOS/serenity/pull/8449
3 changed files with 13 additions and 1 deletions
|
@ -637,4 +637,11 @@ void Node::serialize_tree_as_json(JsonObjectSerializer<StringBuilder>& object) c
|
|||
}
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/webappapis.html#concept-n-noscript
|
||||
bool Node::is_scripting_disabled() const
|
||||
{
|
||||
// FIXME: or when scripting is disabled for its relevant settings object.
|
||||
return !document().browsing_context();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue