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
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

@ -134,18 +134,6 @@ WebIDL::Long Navigator::max_touch_points()
return 0;
}
// https://www.w3.org/TR/tracking-dnt/#dom-navigator-donottrack
Optional<FlyString> Navigator::do_not_track() const
{
// The value is null if no DNT header field would be sent (e.g., because a tracking preference is not
// enabled and no user-granted exception is applicable); otherwise, the value is a string beginning with
// "0" or "1", possibly followed by DNT-extension characters.
if (ResourceLoader::the().enable_do_not_track())
return "1"_fly_string;
return {};
}
GC::Ref<ServiceWorker::ServiceWorkerContainer> Navigator::service_worker()
{
if (!m_service_worker_container)