LibWeb+LibWebView+WebContent: Replace DNT with GPC

Global Privacy Control aims to be a replacement for Do Not Track. DNT
ended up not being a great solution, as it wasn't enforced by law. This
actually resulted in the DNT header serving as an extra fingerprinting
data point.

GPC is becoming enforced by law in USA states such as California and
Colorado. CA is further working on a bill which requires that browsers
implement such an opt-out preference signal (OOPS):

https://cppa.ca.gov/announcements/2025/20250911.html

This patch replaces DNT with GPC and hooks up the associated settings.
This commit is contained in:
Timothy Flynn 2025-04-02 09:30:34 -04:00 committed by Jelle Raaijmakers
parent d9ebd44924
commit b4df857a57
Notes: github-actions[bot] 2025-09-16 08:39:19 +00:00
22 changed files with 105 additions and 60 deletions

View file

@ -605,7 +605,7 @@ void ViewImplementation::initialize_client(CreateNewClient create_new_client)
default_zoom_level_factor_changed();
languages_changed();
autoplay_settings_changed();
do_not_track_changed();
global_privacy_control_changed();
}
void ViewImplementation::handle_web_content_process_crash(LoadErrorPage load_error_page)
@ -676,10 +676,10 @@ void ViewImplementation::autoplay_settings_changed()
client().async_set_autoplay_allowlist(page_id(), autoplay_settings.site_filters.values());
}
void ViewImplementation::do_not_track_changed()
void ViewImplementation::global_privacy_control_changed()
{
auto do_not_track = Application::settings().do_not_track();
client().async_set_enable_do_not_track(page_id(), do_not_track == DoNotTrack::Yes);
auto global_privacy_control = Application::settings().global_privacy_control();
client().async_set_enable_global_privacy_control(page_id(), global_privacy_control == GlobalPrivacyControl::Yes);
}
static ErrorOr<LexicalPath> save_screenshot(Gfx::Bitmap const* bitmap)