LibWebView: Add do-not-track setting to about:settings

This commit is contained in:
Timothy Flynn 2025-04-02 09:47:44 -04:00 committed by Tim Flynn
parent 49dae536a7
commit 1be3e7fd8a
Notes: github-actions[bot] 2025-04-02 18:17:25 +00:00
7 changed files with 66 additions and 0 deletions

View file

@ -605,6 +605,7 @@ void ViewImplementation::initialize_client(CreateNewClient create_new_client)
client().async_debug_request(m_client_state.page_index, "spoof-user-agent"sv, *user_agents.get(*user_agent_preset));
autoplay_settings_changed();
do_not_track_changed();
}
void ViewImplementation::handle_web_content_process_crash(LoadErrorPage load_error_page)
@ -663,6 +664,12 @@ void ViewImplementation::autoplay_settings_changed()
client().async_set_autoplay_allowlist(page_id(), autoplay_settings.site_filters.values());
}
void ViewImplementation::do_not_track_changed()
{
auto do_not_track = Application::settings().do_not_track();
client().async_set_enable_do_not_track(page_id(), do_not_track == DoNotTrack::Yes);
}
static ErrorOr<LexicalPath> save_screenshot(Gfx::ShareableBitmap const& bitmap)
{
if (!bitmap.is_valid())