Disable FLoC on your hapi server
npm install dont-give-a-floc
This module is a hapi plugin to control whether FLoC is allowed on pages served by your hapi server, using the Permissions-Policy header. You may disable FLoC to protect your users' privacy, preventing access to their cohorts via browser APIs (including in third-party scripts on your page), and opting your site out of FLoC calculations which are based on user browsing history.
Simply register the plugin to your server, optionally passing the disableFloc
plugin option if you'd like it to take effect across all routes. Otherwise, you can disable FLoC on individual routes using the route.options.plugins.disableFloc
option.
const Hapi = require('@hapi/hapi');
const DontGiveAFloc = require('dont-give-a-floc');
(async () => {
const server = Hapi.server();
await server.register(DontGiveAFloc);
server.route({
method: 'get',
path: '/',
options: {
plugins: {
disableFloc: true
},
handler(request, h) {
return h.response(`<html>
<head><title>My FLoC-less Homepage</title></head>
<body>No FLoCs given!</body>
</html>`).type('text/html');
}
}
});
})();
- Opting your Website out of Google's FLoC Network
- How can websites opt out of the FLoC computation?
- Federated Learning of Cohorts (FLoC)
- What is Federated Learning of Cohorts (FLoC)?
- WordPress to automatically disable Google FLoC on websites
- Google’s FLoC Is a Terrible Idea
- How to fight back against Google FLoC
- Am I FLoCed?