LibWeb/CSP: Implement the script-src directive

This commit is contained in:
Luke Wilde 2024-12-02 16:01:19 +00:00 committed by Andrew Kaster
parent 3d43462ccd
commit 0cff47828d
Notes: github-actions[bot] 2025-07-09 21:53:59 +00:00
17 changed files with 839 additions and 14 deletions

View file

@ -6,6 +6,7 @@
#pragma once
#include <LibJS/Runtime/VM.h>
#include <LibWeb/ContentSecurityPolicy/Directives/Directive.h>
namespace Web::ContentSecurityPolicy {
@ -22,4 +23,8 @@ Directives::Directive::Result should_navigation_response_to_navigation_request_o
Directives::Directive::NavigationType navigation_type,
GC::Ref<HTML::Navigable> target);
Directives::Directive::Result should_elements_inline_type_behavior_be_blocked_by_content_security_policy(JS::Realm&, GC::Ref<DOM::Element> element, Directives::Directive::InlineType type, String const& source);
JS::ThrowCompletionOr<void> ensure_csp_does_not_block_string_compilation(JS::Realm& realm, ReadonlySpan<String> parameter_strings, StringView body_string, StringView code_string, JS::CompilationType compilation_type, ReadonlySpan<JS::Value> parameter_args, JS::Value body_arg);
JS::ThrowCompletionOr<void> ensure_csp_does_not_block_wasm_byte_compilation(JS::Realm&);
}