Permissions-Policy: ambient-light-sensor
        
        
          Limited availability
        
        
        
          
                
              
                
              
                
              
        
        
      
      This feature is not Baseline because it does not work in some of the most widely-used browsers.
HTTP Permissions-Policy 标头的 ambient-light-sensor 指令控制当前文档是否被允许通过 AmbientLightSensor 接口收集设备周围环境中的光亮信息。
具体来说,如果定义的策略阻止使用此特性,则 AmbientLightSensor() 构造函数调用将抛出类型为 SecurityError 的 DOMException。
语法
http
Permissions-Policy: ambient-light-sensor=<allowlist>;
- <allowlist>
- 
允许使用该特性的来源列表。请参阅 Permissions-Policy> 语法了解更多详细信息。
默认策略
ambient-light-sensor 的默认允许列表为:self。
规范
| Specification | 
|---|
| Generic Sensor API> # permissions-policy> | 
浏览器兼容性
Loading…