Thank you for suggesting this. Unfortunately, the snippet you posted does not preserve any (non-FLoC-related) values the header may have. This could lead to issues on sites where the Permissions-Policy header is already in use to control other permissions.
My plugin preserves those values if present, and then adds the “interest-cohort=()”.
Also, functions.php gets overwritten when your theme is updated, so in general it’s not the best option to add your own code there.
Thread Starter
georg
(@georgp)
Right, thanks for the remarks.
However, many WordPress Websites do not have a Permission-Policy header at all (and even no Security header), so overwrite might not apply.
Fair enough. Still, the best way to add the code you suggested would be to roll your own little plugin. Basically, mine exists to save you the trouble :).
It contains a slightly fancier version of the approach in the snippet, and does nothing else.
Thread Starter
georg
(@georgp)
Well, I put it in my nginx conf 🙂 Thank you for providing this plugin for everybody.