mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 17:55:07 +02:00
LibWeb/CSP: Implement the script-src-elem directive
This commit is contained in:
committed by
Shannon Booth
parent
caf45f2317
commit
f382bccc3d
Notes:
github-actions[bot]
2025-07-12 01:07:54 +00:00
Author: https://github.com/Lubrsi Commit: https://github.com/LadybirdBrowser/ladybird/commit/f382bccc3dc Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5404 Reviewed-by: https://github.com/shannonbooth ✅
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright (c) 2024, Luke Wilde <luke@ladybird.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LibWeb/ContentSecurityPolicy/Directives/Directive.h>
|
||||
|
||||
namespace Web::ContentSecurityPolicy::Directives {
|
||||
|
||||
// https://w3c.github.io/webappsec-csp/#directive-script-src-elem
|
||||
class ScriptSourceElementDirective final : public Directive {
|
||||
GC_CELL(ScriptSourceElementDirective, Directive)
|
||||
GC_DECLARE_ALLOCATOR(ScriptSourceElementDirective);
|
||||
|
||||
public:
|
||||
virtual ~ScriptSourceElementDirective() = default;
|
||||
|
||||
virtual Result pre_request_check(GC::Heap&, GC::Ref<Fetch::Infrastructure::Request const>, GC::Ref<Policy const>) const override;
|
||||
virtual Result post_request_check(GC::Heap&, GC::Ref<Fetch::Infrastructure::Request const>, GC::Ref<Fetch::Infrastructure::Response const>, GC::Ref<Policy const>) const override;
|
||||
virtual Result inline_check(GC::Heap&, GC::Ptr<DOM::Element const>, InlineType, GC::Ref<Policy const>, String const&) const override;
|
||||
|
||||
private:
|
||||
ScriptSourceElementDirective(String name, Vector<String> value);
|
||||
};
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user