Show / Hide Table of Contents

Class FeaturePolicy

Policy to selectively enable and disable use of various browser features and APIs.

Inheritance
System.Object
FeaturePolicy
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Lib.AspNetCore.Security.Http.Headers
Assembly: Lib.AspNetCore.Security.dll
Syntax
[Obsolete("Feature Policy has been replaced with Permissions Policy.")]
public class FeaturePolicy

Properties

Camera

Gets or sets the allowlist (the set of allowed origins) for access to video input devices.

Declaration
public string[] Camera { get; set; }
Property Value
Type Description
System.String[]

EncryptedMedia

Gets or sets the allowlist (the set of allowed origins) for access to requestMediaKeySystemAccess().

Declaration
public string[] EncryptedMedia { get; set; }
Property Value
Type Description
System.String[]

Fullscreen

Gets or sets the allowlist (the set of allowed origins) for access to requestFullscreen().

Declaration
public string[] Fullscreen { get; set; }
Property Value
Type Description
System.String[]

Geolocation

Gets or sets the allowlist (the set of allowed origins) for access to Geolocation interface.

Declaration
public string[] Geolocation { get; set; }
Property Value
Type Description
System.String[]

Microphone

Gets or sets the allowlist (the set of allowed origins) for access to audio input devices.

Declaration
public string[] Microphone { get; set; }
Property Value
Type Description
System.String[]

Midi

Gets or sets the allowlist (the set of allowed origins) for access to requestMIDIAccess().

Declaration
public string[] Midi { get; set; }
Property Value
Type Description
System.String[]

Payment

Gets or sets the allowlist (the set of allowed origins) for access to PaymentRequest interface.

Declaration
public string[] Payment { get; set; }
Property Value
Type Description
System.String[]

Speaker

Gets or sets the allowlist (the set of allowed origins) for access to audio output devices.

Declaration
public string[] Speaker { get; set; }
Property Value
Type Description
System.String[]

Vibrate

Gets or sets the allowlist (the set of allowed origins) for access to vibrate().

Declaration
public string[] Vibrate { get; set; }
Property Value
Type Description
System.String[]

Methods

GetFeatureAllowList(String)

Gets the feature allowlist (the set of allowed origins).

Declaration
public string[] GetFeatureAllowList(string feature)
Parameters
Type Name Description
System.String feature

The feature name.

Returns
Type Description
System.String[]

The allowlist (the set of allowed origins).

SetFeatureAllowList(String, String[])

Sets the feature allowlist (the set of allowed origins).

Declaration
public void SetFeatureAllowList(string feature, params string[] allowList)
Parameters
Type Name Description
System.String feature

The feature name.

System.String[] allowList

The allowlist (the set of allowed origins).

ToPolicyDirectiveJson(Boolean)

Serializes the policy to a directive in form of a JSON text (policy-directive-json).

Declaration
public string ToPolicyDirectiveJson(bool forHttpHeader)
Parameters
Type Name Description
System.Boolean forHttpHeader

The flag indicating if policy is being serialized for HTTP header.

Returns
Type Description
System.String

The policy directive in form of a JSON text (policy-directive-json).

Back to top Copyright © 2016 - 2023 Tomasz Pęczek