Package Exports
- permissions-policy
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (permissions-policy) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Permissions Policy
NOTE: Since the Feature-Policy header was deprecated I've decided to adapt the old Evan Hahn Permissions-Policy repository, this project was entirely built on top of his work.
This is a Express middleware to set the Permissions-Policy header. You can read more about it here.
To use:
const permissionsPolicy = require("permissions-policy");
// ...
app.use(
permissionsPolicy({
features: {
fullscreen: ["self"], // fullscreen=()
vibrate: ["none"], // vibrate=(none)
payment: ["self", '"example.com"'], // payment=(self "example.com")
syncXhr: [], // syncXhr=()
},
})
);The following features are currently supported:
accelerometerambientLightSensorautoplaybatterycameradisplayCapturedocumentDomaindocumentWriteencryptedMediaexecutionWhileNotRenderedexecutionWhileOutOfViewportfontDisplayLateSwapfullscreengeolocationgyroscopeinterestCohortlayoutAnimationslegacyImageFormatsloadingFrameDefaultEagermagnetometermicrophonemidinavigationOverridenotificationsoversizedImagespaymentpictureInPicturepublickeyCredentialspushserialspeakersyncScriptsyncXhrunoptimizedImagesunoptimizedLosslessImagesunoptimizedLossyImagesunsizedMediausbverticalScrollvibratevrwakeLockxrxrSpatialTracking