Restrict browser features with Permissions-Policy
अपडेट: 1 दिस॰ 2026
यह गाइड अभी अंग्रेज़ी में है।
What it means
Permissions-Policy lets you switch off powerful browser features (camera, microphone, geolocation) your site does not use, so injected or third-party scripts cannot use them either.
Why it matters
Low on its own, but reduces what a compromised third-party script could do to your visitors.
How to fix it
- List the browser features your site really needs.
- Send a Permissions-Policy header disabling everything else.
Configuration examples
nginx
add_header Permissions-Policy "camera=(), microphone=(), geolocation=(), payment=()" always;
Apache
Header always set Permissions-Policy "camera=(), microphone=(), geolocation=(), payment=()"
Node.js / Express
app.use((req, res, next) => { res.setHeader('Permissions-Policy', 'camera=(), microphone=(), geolocation=()'); next(); });
Any platform
Permissions-Policy: camera=(), microphone=(), geolocation=(), payment=()
Check your fix
curl -sI https://YOUR_DOMAIN | grep -i permissions-policy
References
- https://developer.mozilla.org/docs/Web/HTTP/Headers/Permissions-Policy