@@ -767,12 +767,15 @@ def __init__(self) -> None:
767767 self .__policy : List [str ] = []
768768 self .header = "Permissions-Policy"
769769 self .value = (
770- "accelerometer=(), ambient-light-sensor=(), autoplay=(),"
771- "camera=(), encrypted-media=(), fullscreen=(),"
772- "geolocation=(), gyroscope=(), magnetometer=(),"
773- "microphone=(); midi=(), payment=(),"
774- "picture-in-picture=(), speaker=(), sync-xhr=(), usb=(),"
775- "vr=()"
770+ "accelerometer=(), ambient-light-sensor=(), autoplay=(), battery=(), "
771+ "camera=(), clipboard-read=(), clipboard-write=(), cross-origin-isolated=(), "
772+ "display-capture=(), document-domain=(), encrypted-media=(), "
773+ "execution-while-not-rendered=(), execution-while-out-of-viewport=(), "
774+ "fullscreen=(), gamepad=(), geolocation=(), gyroscope=(), magnetometer=(), "
775+ "microphone=(), midi=(), navigation-override=(), payment=(), "
776+ "picture-in-picture=(), publickey-credentials-get=(), screen-wake-lock=(), "
777+ "speaker-selection=(), sync-xhr=(), usb=(), web-share=(), "
778+ "xr-spatial-tracking=()"
776779 )
777780
778781 def _build (self , directive : str , * sources : str ) -> None :
@@ -788,17 +791,37 @@ def accelerometer(self, *allowlist: str) -> "PermissionsPolicy":
788791 return self
789792
790793 def ambient_light_sensor (self , * allowlist : str ) -> "PermissionsPolicy" :
791- self ._build ("ambient-light-sensor " , * allowlist )
794+ self ._build ("ambient-light-sensor" , * allowlist )
792795 return self
793796
794797 def autoplay (self , * allowlist : str ) -> "PermissionsPolicy" :
795798 self ._build ("autoplay" , * allowlist )
796799 return self
797800
801+ def battery (self , * allowlist : str ) -> "PermissionsPolicy" :
802+ self ._build ("battery" , * allowlist )
803+ return self
804+
798805 def camera (self , * allowlist : str ) -> "PermissionsPolicy" :
799806 self ._build ("camera" , * allowlist )
800807 return self
801808
809+ def clipboard_read (self , * allowlist : str ) -> "PermissionsPolicy" :
810+ self ._build ("clipboard-read" , * allowlist )
811+ return self
812+
813+ def clipboard_write (self , * allowlist : str ) -> "PermissionsPolicy" :
814+ self ._build ("clipboard-write" , * allowlist )
815+ return self
816+
817+ def cross_origin_isolated (self , * allowlist : str ) -> "PermissionsPolicy" :
818+ self ._build ("cross-origin-isolated" , * allowlist )
819+ return self
820+
821+ def display_capture (self , * allowlist : str ) -> "PermissionsPolicy" :
822+ self ._build ("display-capture" , * allowlist )
823+ return self
824+
802825 def document_domain (self , * allowlist : str ) -> "PermissionsPolicy" :
803826 self ._build ("document-domain" , * allowlist )
804827 return self
@@ -807,10 +830,22 @@ def encrypted_media(self, *allowlist: str) -> "PermissionsPolicy":
807830 self ._build ("encrypted-media" , * allowlist )
808831 return self
809832
833+ def execution_while_not_rendered (self , * allowlist : str ) -> "PermissionsPolicy" :
834+ self ._build ("execution-while-not-rendered" , * allowlist )
835+ return self
836+
837+ def execution_while_out_of_viewport (self , * allowlist : str ) -> "PermissionsPolicy" :
838+ self ._build ("execution-while-out-of-viewport" , * allowlist )
839+ return self
840+
810841 def fullscreen (self , * allowlist : str ) -> "PermissionsPolicy" :
811842 self ._build ("fullscreen" , * allowlist )
812843 return self
813844
845+ def gamepad (self , * allowlist : str ) -> "PermissionsPolicy" :
846+ self ._build ("gamepad" , * allowlist )
847+ return self
848+
814849 def geolocation (self , * allowlist : str ) -> "PermissionsPolicy" :
815850 self ._build ("geolocation" , * allowlist )
816851 return self
@@ -831,6 +866,10 @@ def midi(self, *allowlist: str) -> "PermissionsPolicy":
831866 self ._build ("midi" , * allowlist )
832867 return self
833868
869+ def navigation_override (self , * allowlist : str ) -> "PermissionsPolicy" :
870+ self ._build ("navigation-override" , * allowlist )
871+ return self
872+
834873 def payment (self , * allowlist : str ) -> "PermissionsPolicy" :
835874 self ._build ("payment" , * allowlist )
836875 return self
@@ -839,10 +878,26 @@ def picture_in_picture(self, *allowlist: str) -> "PermissionsPolicy":
839878 self ._build ("picture-in-picture" , * allowlist )
840879 return self
841880
881+ def publickey_credentials_get (self , * allowlist : str ) -> "PermissionsPolicy" :
882+ self ._build ("publickey-credentials-get" , * allowlist )
883+ return self
884+
885+ def screen_wake_lock (self , * allowlist : str ) -> "PermissionsPolicy" :
886+ self ._build ("screen-wake-lock" , * allowlist )
887+ return self
888+
842889 def speaker (self , * allowlist : str ) -> "PermissionsPolicy" :
890+ warnings .warn (
891+ "'speaker' feature was removed in favor of 'speaker_selection'" ,
892+ DeprecationWarning ,
893+ )
843894 self ._build ("speaker" , * allowlist )
844895 return self
845896
897+ def speaker_selection (self , * allowlist : str ) -> "PermissionsPolicy" :
898+ self ._build ("speaker-selection" , * allowlist )
899+ return self
900+
846901 def sync_xhr (self , * allowlist : str ) -> "PermissionsPolicy" :
847902 self ._build ("sync-xhr" , * allowlist )
848903 return self
@@ -851,10 +906,24 @@ def usb(self, *allowlist: str) -> "PermissionsPolicy":
851906 self ._build ("usb" , * allowlist )
852907 return self
853908
909+ def web_share (self , * allowlist : str ) -> "PermissionsPolicy" :
910+ self ._build ("web-share" , * allowlist )
911+ return self
912+
854913 def vibrate (self , * allowlist : str ) -> "PermissionsPolicy" :
855- self ._build ("vibrate" , * allowlist )
914+ warnings .warn (
915+ "'vibrate' feature has been removed without ever actually having been implemented" ,
916+ DeprecationWarning ,
917+ )
856918 return self
857919
858920 def vr (self , * allowlist : str ) -> "PermissionsPolicy" :
921+ warnings .warn (
922+ "'vr' feature was renamed to 'xr_spatial_tracking'" , DeprecationWarning
923+ )
859924 self ._build ("vr" , * allowlist )
860925 return self
926+
927+ def xr_spatial_tracking (self , * allowlist : str ) -> "PermissionsPolicy" :
928+ self ._build ("xr-spatial-tracking" , * allowlist )
929+ return self
0 commit comments