mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-04 14:58:37 +09:00
Issue #1721 - Implement GlobalPrivacyControl
(and get rid of failed DoNotTrack)
This commit is contained in:
parent
0315aeee73
commit
50ad087351
14 changed files with 41 additions and 50 deletions
|
|
@ -5711,7 +5711,7 @@ nsHttpChannel::BeginConnect()
|
|||
mRequestHead.SetOrigin(scheme, host, port);
|
||||
|
||||
SetOriginHeader();
|
||||
SetDoNotTrack();
|
||||
SetGPC();
|
||||
|
||||
NeckoOriginAttributes originAttributes;
|
||||
NS_GetOriginAttributes(this, originAttributes);
|
||||
|
|
@ -8051,18 +8051,13 @@ nsHttpChannel::SetOriginHeader()
|
|||
}
|
||||
|
||||
void
|
||||
nsHttpChannel::SetDoNotTrack()
|
||||
nsHttpChannel::SetGPC()
|
||||
{
|
||||
/**
|
||||
* 'DoNotTrack' header should be added if 'privacy.donottrackheader.enabled'
|
||||
* is true or tracking protection is enabled. See bug 1258033.
|
||||
* 'Sec-GPC: 1' header should be added if 'privacy.GPCheader.enabled' is true.
|
||||
*/
|
||||
nsCOMPtr<nsILoadContext> loadContext;
|
||||
NS_QueryNotificationCallbacks(this, loadContext);
|
||||
|
||||
if ((loadContext && loadContext->UseTrackingProtection()) ||
|
||||
nsContentUtils::DoNotTrackEnabled()) {
|
||||
mRequestHead.SetHeader(nsHttp::DoNotTrack,
|
||||
if (nsContentUtils::GPCEnabled()) {
|
||||
mRequestHead.SetHeader(nsHttp::GlobalPrivacyControl,
|
||||
NS_LITERAL_CSTRING("1"),
|
||||
false);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue