EmptyFeaturePolicy

class OCP\AppFramework\Http\EmptyFeaturePolicy
Class EmptyFeaturePolicy is a simple helper which allows applications
to modify the FeaturePolicy sent by Nextcloud. Per default the policy
is forbidding everything.
As alternative with sane exemptions look at FeaturePolicy
Source:lib/public/AppFramework/Http/EmptyFeaturePolicy.php#39

Properties

protected static property OCP\AppFramework\Http\EmptyFeaturePolicy::$autoplayDomains
Source:lib/public/AppFramework/Http/EmptyFeaturePolicy.php#42
Type:string[] of allowed domains to autoplay media
protected static property OCP\AppFramework\Http\EmptyFeaturePolicy::$cameraDomains
Source:lib/public/AppFramework/Http/EmptyFeaturePolicy.php#45
Type:string[] of allowed domains that can access the camera
protected static property OCP\AppFramework\Http\EmptyFeaturePolicy::$fullscreenDomains
Source:lib/public/AppFramework/Http/EmptyFeaturePolicy.php#48
Type:string[] of allowed domains that can use fullscreen
protected static property OCP\AppFramework\Http\EmptyFeaturePolicy::$geolocationDomains
Source:lib/public/AppFramework/Http/EmptyFeaturePolicy.php#51
Type:string[] of allowed domains that can use the geolocation of the device
protected static property OCP\AppFramework\Http\EmptyFeaturePolicy::$microphoneDomains
Source:lib/public/AppFramework/Http/EmptyFeaturePolicy.php#54
Type:string[] of allowed domains that can use the microphone
protected static property OCP\AppFramework\Http\EmptyFeaturePolicy::$paymentDomains
Source:lib/public/AppFramework/Http/EmptyFeaturePolicy.php#57
Type:string[] of allowed domains that can use the payment API

Methods

public OCP\AppFramework\Http\EmptyFeaturePolicy::addAllowedAutoplayDomain($domain)
Allows to use autoplay from a specific domain. Use * to allow from all domains.
Source:

lib/public/AppFramework/Http/EmptyFeaturePolicy.php#66

Parameters:
  • $domain (string) Domain to whitelist. Any passed value needs to be properly sanitized.
Returns:

$this

Since:

17.0.0

public OCP\AppFramework\Http\EmptyFeaturePolicy::addAllowedCameraDomain($domain)
Allows to use the camera on a specific domain. Use * to allow from all domains
Source:

lib/public/AppFramework/Http/EmptyFeaturePolicy.php#78

Parameters:
  • $domain (string) Domain to whitelist. Any passed value needs to be properly sanitized.
Returns:

$this

Since:

17.0.0

public OCP\AppFramework\Http\EmptyFeaturePolicy::addAllowedFullScreenDomain($domain)
Allows the full screen functionality to be used on a specific domain. Use * to allow from all domains
Source:

lib/public/AppFramework/Http/EmptyFeaturePolicy.php#90

Parameters:
  • $domain (string) Domain to whitelist. Any passed value needs to be properly sanitized.
Returns:

$this

Since:

17.0.0

public OCP\AppFramework\Http\EmptyFeaturePolicy::addAllowedGeoLocationDomain($domain)
Allows to use the geolocation on a specific domain. Use * to allow from all domains
Source:

lib/public/AppFramework/Http/EmptyFeaturePolicy.php#102

Parameters:
  • $domain (string) Domain to whitelist. Any passed value needs to be properly sanitized.
Returns:

$this

Since:

17.0.0

public OCP\AppFramework\Http\EmptyFeaturePolicy::addAllowedMicrophoneDomain($domain)
Allows to use the microphone on a specific domain. Use * to allow from all domains
Source:

lib/public/AppFramework/Http/EmptyFeaturePolicy.php#114

Parameters:
  • $domain (string) Domain to whitelist. Any passed value needs to be properly sanitized.
Returns:

$this

Since:

17.0.0

public OCP\AppFramework\Http\EmptyFeaturePolicy::addAllowedPaymentDomain($domain)
Allows to use the payment API on a specific domain. Use * to allow from all domains
Source:

lib/public/AppFramework/Http/EmptyFeaturePolicy.php#126

Parameters:
  • $domain (string) Domain to whitelist. Any passed value needs to be properly sanitized.
Returns:

$this

Since:

17.0.0

public OCP\AppFramework\Http\EmptyFeaturePolicy::buildPolicy()
Get the generated Feature-Policy as a string
Source:lib/public/AppFramework/Http/EmptyFeaturePolicy.php#137
Returns:string
Since:17.0.0