ladybird/Libraries/LibWebView/WebUI/SettingsUI.h
Luke Wilde 8dc8835b64 LibWeb+LibWebView+WebContent: Allow muted media to autoplay by default
The autoplay setting was binary and its default blocked all media,
including muted video, leaving sites that rely on muted autoplay
visibly broken. Replace it with a tri-state user-agent autoplay
policy (allow audio and video, block audio, or block audio and video)
defaulting to allowing only inaudible media to autoplay.

This is enforced through the media element's "allowed to play" check,
so unmuting a muted autoplay or calling `play()` cannot slip audio
past the policy; audible playback is permitted once the document has
been activated by the user. The policy lives in a dedicated
AutoplaySettings consulted from HTMLMediaElement instead of the
Permissions Policy "allowed to use feature" check it was previously
conflated with.
2026-06-19 09:41:32 +02:00

50 lines
1.4 KiB
C++

/*
* Copyright (c) 2025-2026, Tim Flynn <trflynn89@ladybird.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibWebView/Forward.h>
#include <LibWebView/WebUI.h>
namespace WebView {
class WEBVIEW_API SettingsUI : public WebUI {
WEB_UI(SettingsUI);
private:
virtual void register_interfaces() override;
void load_features();
void load_current_settings();
void set_new_tab_page_url(JsonValue const&);
void set_tab_settings(JsonValue const&);
void set_default_zoom_level_factor(JsonValue const&);
void set_languages(JsonValue const&);
void set_browsing_behavior(JsonValue const&);
void set_config_variable(JsonValue const&);
void load_available_engines();
void set_search_engine(JsonValue const&);
void add_custom_search_engine(JsonValue const&);
void remove_custom_search_engine(JsonValue const&);
void set_autocomplete_engine(JsonValue const&);
void load_forcibly_enabled_site_settings();
void set_site_setting_policy(JsonValue const&);
void add_site_setting_filter(JsonValue const&);
void remove_site_setting_filter(JsonValue const&);
void remove_all_site_setting_filters(JsonValue const&);
void estimate_browsing_data_sizes(JsonValue const&);
void set_browsing_data_settings(JsonValue const&);
void clear_browsing_data(JsonValue const&);
void set_global_privacy_control(JsonValue const&);
void set_dns_settings(JsonValue const&);
};
}