webzod
account

Add a Permissions-Policy on Netlify

headers.permissions.missing · effort: minutes

Why it matters

Without one, any script on your pages, including injected or third-party code, can ask visitors for the camera, microphone, location and similar features. Turning off what you do not use limits what such code can request.

Staged change. Do this in stages and check each one before the next, so a mistake does not break your site or your mail.

The fix

  1. Add the lines (adjusted to the features you use) to _headers in the publish directory (or [[headers]] in netlify.toml) and redeploy. They do not apply to Netlify Functions, Edge Functions or proxied responses; those must send the header themselves.
  2. Test the pages that use those features.
_headers
/*
  Permissions-Policy: camera=(), microphone=(), geolocation=(), payment=(), usb=()

Read the documentation (opens in a new tab)

Scan your domain to see whether this applies to you.