-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
blog/opting-your-website-out-of-googles-floc-network #2
Comments
The meta tag method does not work. See pull request and discussion at: WICG/floc#47 |
Thank you very much for pointing this out. I've since amended the post to remove the I do have agree with their reasoning; since using a web or proxy server should be the only de facto ways to set HTTP headers. |
We also have developed a WordPress Plug-in for those without the technical knowledge to edit files. |
Since you mention Netlify and Cloudflare Workers, you may also want to add how it’s done if your site is hosted on Vercel. If you don’t already have a {
"headers": [
{
"source": "/(.*)",
"headers": [
{
"key": "Permissions-Policy",
"value": "interest-cohort=()"
}
]
}
]
} Documentation for adding headers to a Vercel site: https://vercel.com/docs/configuration#project/headers |
In HAProxy you can do the following:
|
Thanks for the post! May I suggest a small update to the WordPress snippet, to ensure compatibility with any other /**
* Opting your Website out of Google's FLoC Network.
* Place this snippet in your theme's functions.php, or in a functionality plugin.
*
* @param string[] $headers Associative array of headers to be sent.
*/
add_filter(
'wp_headers',
function ( $headers ) {
if ( empty( $headers['Permissions-Policy'] ) ) {
$headers['Permissions-Policy'] = 'interest-cohort=()';
} elseif (
! empty( $headers['Permissions-Policy'] )
&& false === strpos( $headers['Permissions-Policy'], 'interest-cohort' )
) {
$headers['Permissions-Policy'] .= ', interest-cohort=()';
}
return $headers;
}
); |
@jeherve @daniel-corbett and @brycewray I've added the various code snippets that you provided to the blog post, and added your names to the Acknowledgements section. Thanks for helping to expand and improve the post! |
i refuse to use this comment section, which requires me to login via Github. also, if i have cloudflare infront of my netlify site, is adding the header to netlify enough? namaste |
@wilrnh Thanks for using the comment section :) To answer your question, setting the headers in Netlify is enough (I use the same setup). Cloudflare's edge proxy will pass along all headers set by Netlify's origin. |
FWIW, GitHub Pages should now set the opt out header automatically: |
@foosel Thanks for letting me know about this! I updated the post with that bit of info, and added your name to the Acknowledgements section. |
Since this site is built on Jekyll, do you have any advise? My first thought was to add the Permissions-Policy as an http-equiv meta element, but this isn't supported and caused my linter to yell at me. It might work anyway in which case I can change my linting rules or maybe you recommend running a separate script to add the header to all files? Thanks! |
Should have mentioned I'm using GH Pages on a custom domain. I see you've added "However, there is no way to add custom HTTP headers when using GitHub Pages with a custom domain" but I refuse to believe that could be true! |
@mikedinicola The
My advice to anyone using Jekyll is to use Netlify 😄 since they're the best.
GitHub pages has a number of feature requests in their Community Support Site as it relates to setting custom HTTP response headers in GitHub pages, but so far that feature hasn't been confirmed. |
Restarting the server is not possible for many hosting companies, specially shared hosting. Will it work without a restart? How about using the plugin https://wordpress.org/plugins/wpm-floc/ or inserting the code via WP hook, that will not restart the server, so will it work? |
@vayurobins For web servers that support a graceful restart you can definitely use something like Since the type of folks executing these commands would have sysadmin experience — and would make up their mind about any perceived downtime based on their individual needs — I kept the commands as standardized as possible. In terms of WordPress, it's indeed possible to use a plugin that inserts the The only plugin I've tested and can recommend is Disable FLoC by Roy Tanck as it takes into consideration the existence of other headers, and is written by a WP Core Contributor. |
If someone is unable to change their web/proxy server and uses Symfony, they could use loophp/go-unfloc-yourself-bundle. If it detects an existing |
The problem here is that we do not trust google. So why would we trust them to heed this header? We shouldn't. Blocking this will require something at the transport/protocol level, a deep packet inspection firewall and filter might be able to do it. |
It appears that there are now two more
source: WICG/turtledove@ebd96b8 The existing |
Opting your Website out of Google's FLoC Network - Paramdeo Singh
You can remove your website from Google's FLoC rollout by altering HTTP response headers.
https://paramdeo.com//blog/opting-your-website-out-of-googles-floc-network
The text was updated successfully, but these errors were encountered: