-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
47befab
commit 32b2c78
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
'use strict'; | ||
|
||
module.exports = { | ||
id: 'disableFLoCHeader', | ||
title: | ||
'Set a permission policy header that opt out your users being tracked in Chrome.', | ||
description: | ||
'Googles new tracking method is called Federated Learning of Cohorts (FLoC) and it groups you based on your interests and demographics, derived from your browsing history, to enable creepy advertising and other content targeting without third-party cookies. You can avoid that by setting a Permissions-Policy header with the value of interest-cohort=(). See https://spreadprivacy.com/block-floc-with-duckduckgo/.', | ||
weight: 8, | ||
tags: ['headers', 'privacy'], | ||
processPage: function (page) { | ||
const offending = []; | ||
let score = 0; | ||
let advice = ''; | ||
const finalUrl = page.finalUrl; | ||
page.assets.forEach(function (asset) { | ||
if (asset.url === finalUrl) { | ||
const headers = asset.headers.response; | ||
if (headers['Permissions-Policy'] === 'interest-cohort=()') { | ||
score = 100; | ||
} else { | ||
offending.push(asset.url); | ||
} | ||
} | ||
}); | ||
if (score === 0) { | ||
advice = | ||
'Set a permission policy header that opt out Chrome for tracking what your users do on your site.'; | ||
} | ||
return { | ||
score: score, | ||
offending: offending, | ||
advice: advice | ||
}; | ||
} | ||
}; |