feature-policy
    Overview
    Documentation
    Insights
    Code
    Contributors
    Dependencies
    Alternatives

feature-policy

Middleware to set the Feature-Policy HTTP header

0.4.0  •  Published 3 months ago  •  by helmetjs  •  MIT License

Feature Policy

Build Status

This is Express middleware to set the Feature-Policy header. You can read more about it here and here.

To use:

const featurePolicy = require('feature-policy')

// ...

app.use(featurePolicy({
  features: {
    fullscreen: ["'self'"],
    vibrate: ["'none'"],
    payment: ['example.com'],
    syncXhr: ["'none'"]
  }
}))

The following features are currently supported:

  • accelerometer
  • ambientLightSensor
  • autoplay
  • camera
  • documentDomain
  • documentWrite
  • encryptedMedia
  • fontDisplayLateSwap
  • fullscreen
  • geolocation
  • gyroscope
  • layoutAnimations
  • legacyImageFormats
  • loadingFrameDefaultEager
  • magnetometer
  • microphone
  • midi
  • oversizedImages
  • payment
  • pictureInPicture
  • serial
  • speaker
  • syncScript
  • syncXhr
  • unoptimizedImages
  • unoptimizedLosslessImages
  • unoptimizedLossyImages
  • unsizedMedia
  • usb
  • verticalScroll
  • vibrate
  • vr
  • wakeLock
  • xr
How do you feel about the name Devstore for this site?

Popularity

Weekly Downloads
463.2K
Stars
7

Maintenance

Development

Last ver 3 months ago
Created 1 year ago
Last commit 3 months ago
13 days between commits

Technology

Node version: 12.6.0
9.8K unpacked

Compliance

MIT License
OSI Approved
0 vulnerabilities

Contributors

2 contributors
Evan Hahn
Maintainer, 26 commits, 1 merges
Works at Airtable
michael
1 commits, 1 PRs
Adam Baldwin
Maintainer
Works at npm

Tags

helmet
security
express
connect
feature-policy
Ready for the next level?
Join Devstore's founding team to help us build the ultimate open-source app store, work with the latest technologies, and enjoy great culture, impact and autonomy
© 2019 Devstore, Inc.
Devstore helps developers find and use open-source packages, so they can focus on building amazing things