PermissionsPolicy.add_directive()

Add or replace a directive.

Usage

Source

PermissionsPolicy.add_directive(
    directive,
    *allowlist,
)

Parameters

directive: str

The directive name (e.g. “geolocation”, “camera”, “fullscreen”).

*allowlist: str
Allowlist tokens. Examples:
  • no tokens -> () (disabled)
  • ” -> (allowed everywhere)
  • “self”, “https://a.example.com” -> (self “https://a.example.com”)

Returns

PermissionsPolicy
The instance (for chaining).