2022-08-04 20:10:09 +02:00
|
|
|
/*
|
2024-10-04 13:19:50 +02:00
|
|
|
* Copyright (c) 2022, Andreas Kling <andreas@ladybird.org>
|
2022-08-04 20:10:09 +02:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2023-11-22 08:45:50 +13:00
|
|
|
#include <AK/String.h>
|
2022-09-13 17:42:39 +02:00
|
|
|
|
2022-08-04 20:10:09 +02:00
|
|
|
namespace Web::HTML {
|
|
|
|
|
|
|
|
// https://html.spec.whatwg.org/multipage/origin.html#cross-origin-opener-policy-value
|
2024-09-18 19:48:22 +02:00
|
|
|
enum class OpenerPolicyValue {
|
2022-08-04 20:10:09 +02:00
|
|
|
UnsafeNone,
|
|
|
|
SameOriginAllowPopups,
|
|
|
|
SameOrigin,
|
|
|
|
SameOriginPlusCOEP,
|
2025-02-21 23:05:17 +08:00
|
|
|
NoopenerAllowPopups,
|
2022-08-04 20:10:09 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
// https://html.spec.whatwg.org/multipage/origin.html#cross-origin-opener-policy
|
2024-09-18 19:48:22 +02:00
|
|
|
struct OpenerPolicy {
|
|
|
|
// A value, which is an opener policy value, initially "unsafe-none".
|
|
|
|
OpenerPolicyValue value { OpenerPolicyValue::UnsafeNone };
|
2022-08-04 20:10:09 +02:00
|
|
|
|
|
|
|
// A reporting endpoint, which is string or null, initially null.
|
2023-11-22 08:45:50 +13:00
|
|
|
Optional<String> reporting_endpoint;
|
2022-08-04 20:10:09 +02:00
|
|
|
|
2024-09-18 19:48:22 +02:00
|
|
|
// A report-only value, which is an opener policy value, initially "unsafe-none".
|
|
|
|
OpenerPolicyValue report_only_value { OpenerPolicyValue::UnsafeNone };
|
2022-08-04 20:10:09 +02:00
|
|
|
|
|
|
|
// A report-only reporting endpoint, which is a string or null, initially null.
|
2023-11-22 08:45:50 +13:00
|
|
|
Optional<String> report_only_reporting_endpoint;
|
2022-08-04 20:10:09 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|