Feature Policy

Demo Pages

What's a feature policy?

Feature Policy is a new way of controlling the availability of features on the web platform — you can read more on this page, or check out the Web Fundamentals blog post.

What can I use feature policy for?

Quite a bit, actually!

Control the use of powerful features on your site:

  • Fullscreen
  • Video Autoplay
  • Encrypted Media
  • Geolocation
  • Device Sensors
  • Picture-in-picture
  • Camera access
  • Microphone access
  • Payment requests
  • WebVR
  • WebUSB
  • WebMIDI

Improve your site's performance by disabling things that make sites slow:

  • Synchronous XMLHttpRequest
  • Layout-inducing animations (Coming soon)
  • Unsized images (Coming soon)
  • Oversized or unoptimized images (Coming soon)
  • document.write (Coming soon)
  • Synchronous script elements (Coming soon)

Try it on your site!

Include this header with pages served from your site:

Feature-Policy: oversized-images 'none'; sync-xhr 'none';
                unoptimized-images 'none'; unsized-media 'none'

Try it in DevTools!

Chrome DevTools Extension

Try a demo!

https://feature-policy-demos.appspot.com/