LibWebView+WebContent+UI: Migrate to the new autoplay settings

This removes the old autoplay allowlist file in favor of the new site
setting. We still support the command-line flag to enable autoplay
globally, as this is needed for WPT.
This commit is contained in:
Timothy Flynn 2025-03-29 08:19:00 -04:00 committed by Tim Ledbetter
commit ed265b568d
Notes: github-actions[bot] 2025-03-30 15:20:08 +00:00
20 changed files with 17 additions and 137 deletions

View file

@ -104,12 +104,6 @@ BrowserWindow::BrowserWindow(Vector<URL::URL> const& initial_urls, IsPopupWindow
});
});
QObject::connect(Settings::the(), &Settings::enable_autoplay_changed, this, [this](bool enable) {
for_each_tab([enable](auto& tab) {
tab.set_enable_autoplay(enable);
});
});
QObject::connect(Settings::the(), &Settings::preferred_languages_changed, this, [this](QStringList languages) {
Vector<String> preferred_languages;
preferred_languages.ensure_capacity(languages.length());
@ -881,7 +875,6 @@ void BrowserWindow::initialize_tab(Tab* tab)
tab->set_preferred_languages(preferred_languages);
tab->set_navigator_compatibility_mode(navigator_compatibility_mode());
tab->set_enable_do_not_track(Settings::the()->enable_do_not_track());
tab->set_enable_autoplay(WebView::Application::web_content_options().enable_autoplay == WebView::EnableAutoplay::Yes || Settings::the()->enable_autoplay());
tab->view().set_preferred_color_scheme(m_preferred_color_scheme);
}