XRPermissionRequest#

Added in version 2.52.

class XRPermissionRequest(**properties: Any)#

Superclasses: Object

Implemented Interfaces: PermissionRequest

A permission request for accessing virtual reality (VR) and augmented reality (AR) devices, including sensors and head-mounted displays.

WebKitXRPermissionRequest represents a request for permission to decide whether WebKit can initialize an XR session through the WebXR API.

When a WebKitXRPermissionRequest is not handled by the user, it is denied by default.

Methods#

class XRPermissionRequest

Gets the optional features that need user consent.

These features can be granted by calling set_granted_optional_features() before allowing the request with allow().

Added in version 2.52.

Gets the required features that need user consent.

These features are automatically granted if the request is allowed with allow().

Added in version 2.52.

get_granted_features() XRSessionFeatures#

Gets the features requested by the origin for the XR device, which are either granted by default or have been explicitly granted by the user.

Added in version 2.52.

get_optional_features_requested() XRSessionFeatures#

Gets the full set of optional features requested by the web application.

This includes both already granted features and those requiring consent.

Added in version 2.52.

get_required_features_requested() XRSessionFeatures#

Gets the full set of required features requested by the web application.

This includes both already granted features and those requiring consent.

Added in version 2.52.

get_security_origin() SecurityOrigin#

Gets the security origin that initiated the permission request.

Added in version 2.52.

get_session_mode() XRSessionMode#

Gets the session mode for which permission is being requested.

Added in version 2.52.

set_granted_optional_features(granted: XRSessionFeatures) None#

Sets which optional features should be granted if the permission request is allowed.

This function should be called with a subset of the features from get_consent_optional_features() before calling allow(). If the request is denied, no features are granted, regardless of what is set here.

Added in version 2.52.

Parameters:

granted – granted features