[Feature request] Set HTTP header to opt out of FLoC in GitHub Pages

For GitHub Pages, we ought to be able to opt out of computation in Google’s Federated Learning of Cohorts (FLoC).

Currently this is not possible via HTML, see <https://github.com/WICG/floc/pull/47>:

How do you opt out if you are on a shared hosting plan where you can’t set HTTP headers?
dmarti

There isn’t a way right now, and I agree that we should add one.
michaelkleber

Therefore, can we have GitHub Pages set the required header for opting out?

For example, a site can opt out of all FLoC cohort calculation by sending the HTTP response header:

Permissions-Policy: interest-cohort=()
2 Likes

I think custom http header is not supported on Github Pages.

I tried doing this in JavaScript using Headers.set() but it did not work. It would be great if this could be implemented.

I think custom http header is not supported on Github Pages.

Correct, that’s why I’m requesting HTTP header support be implemented.

I would be equally happy if GitHub just applied the opt-out header by default.

So they have opted out but only for sites on github.io. I wonder what the way forward for custom domains is.

FLoC could be a flag/checkbox similar to HTTPS alongside custom domain settings. It would be a pain to implement any other way (e.g. via another file in commit or whatever) and frankly too much hassle to remember all because FLoC is “opt-out”.

2 Likes

Do GitHub Pages contain ads?

This whole discussion is a no-op for pages that don’t load ads, since those are the only pages that the document.interestCohort() API pays attention to.

1 Like