Class PermissionsPolicyConfig
Permissions Policy (formerly Feature Policy) allows fine-grained control over which browser features and APIs can be used in a document or iframe. This helps: - Improve privacy by disabling unnecessary sensors/APIs - Enhance security by limiting attack surface - Enforce best practices by preventing use of legacy APIs - Improve performance by disabling unused features
The policy is not set by default, allowing applications to define policies based on their specific needs. Common uses include: - Disabling geolocation, camera, microphone for privacy - Preventing payment APIs on non-payment pages - Disabling legacy features like document-write - Restricting autoplay to improve user experience
Example policies: - "geolocation=(), camera=(), microphone=()" - Disable sensors - "payment=(self)" - Only allow payments on same origin - "accelerometer=() gyroscope=() magnetometer=()" - Disable motion sensors
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
DEFAULT_PERMISSIONS_POLICY_VALUE
- See Also:
-
-
Constructor Details
-
PermissionsPolicyConfig
public PermissionsPolicyConfig()
-
-
Method Details
-
getValue
-
setValue
-