mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
LibWeb/CSP: Introduce the ability to create and report a violation
A violation provides several details about an enforcement failing, such as the URL of the document, the directive that returned "Blocked", etc.
This commit is contained in:
committed by
Alexander Kalenik
parent
02236be737
commit
86170f4bfd
Notes:
github-actions[bot]
2025-03-18 23:56:26 +00:00
Author: https://github.com/Lubrsi Commit: https://github.com/LadybirdBrowser/ladybird/commit/86170f4bfd3 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3972
@@ -12,9 +12,18 @@
|
||||
|
||||
namespace Web::Infra {
|
||||
|
||||
using JSONBaseValue = Variant<Empty, u16, u32, bool, String>;
|
||||
using JSONValue = Variant<JSONBaseValue, Vector<JSONBaseValue>>;
|
||||
struct JSONObject {
|
||||
OrderedHashMap<String, Variant<JSONValue, JSONObject>> value;
|
||||
};
|
||||
using JSONTopLevel = Variant<JSONValue, JSONObject>;
|
||||
|
||||
WebIDL::ExceptionOr<JS::Value> parse_json_string_to_javascript_value(JS::Realm&, StringView);
|
||||
WebIDL::ExceptionOr<JS::Value> parse_json_bytes_to_javascript_value(JS::Realm&, ReadonlyBytes);
|
||||
WebIDL::ExceptionOr<String> serialize_javascript_value_to_json_string(JS::VM&, JS::Value);
|
||||
WebIDL::ExceptionOr<ByteBuffer> serialize_javascript_value_to_json_bytes(JS::VM&, JS::Value);
|
||||
String serialize_an_infra_value_to_a_json_string(JS::Realm&, JSONTopLevel const&);
|
||||
ByteBuffer serialize_an_infra_value_to_json_bytes(JS::Realm&, JSONTopLevel const&);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user