mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-15 21:41:58 +00:00
Some checks are pending
CI / Lagom (arm64, Sanitizer_CI, false, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (x86_64, Fuzzers_CI, false, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, false, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, true, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
37 lines
763 B
C++
37 lines
763 B
C++
/*
|
|
* Copyright (c) 2023-2025, Tim Flynn <trflynn89@ladybird.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/Forward.h>
|
|
#include <AK/Variant.h>
|
|
#include <AK/Vector.h>
|
|
#include <LibURL/Forward.h>
|
|
#include <LibWeb/Forward.h>
|
|
#include <LibWeb/PermissionsPolicy/Decision.h>
|
|
|
|
namespace Web::PermissionsPolicy {
|
|
|
|
class AutoplayAllowlist {
|
|
public:
|
|
static AutoplayAllowlist& the();
|
|
|
|
Decision is_allowed_for_origin(DOM::Document const&, URL::Origin const&) const;
|
|
|
|
void enable_globally();
|
|
void enable_for_origins(ReadonlySpan<String>);
|
|
|
|
private:
|
|
AutoplayAllowlist();
|
|
~AutoplayAllowlist();
|
|
|
|
using Patterns = Vector<URL::Origin>;
|
|
struct Global { };
|
|
|
|
Optional<Variant<Patterns, Global>> m_allowlist;
|
|
};
|
|
|
|
}
|