Skip to content

Commit

Permalink
Add advice to disable FLoC
Browse files Browse the repository at this point in the history
  • Loading branch information
soulgalore committed Apr 9, 2021
1 parent 47befab commit 32b2c78
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions lib/har/privacy/disableFLoCHeader.js
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
};
}
};

0 comments on commit 32b2c78

Please sign in to comment.