Permissions-Policy: web-share
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
HTTP Permissions-Policy 标头的 web-share 指令控制当前文档是否允许使用 Web Share API 的 Navigator.share() 方法将文本、链接、图像和其他内容分享到用户选择的任意目标。
具体而言,如果定义的策略阻止使用此特性,则调用 Navigator.share() 将以 NotAllowedError 类型的 DOMException 拒绝其返回的 Promise。
语法
http
Permissions-Policy: web-share=<allowlist>;
<allowlist>-
允许使用该特性的来源列表。请参阅
Permissions-Policy> 语法了解更多详细信息。
默认策略
web-share 的默认允许列表为:self。
规范
| Specification |
|---|
| Web Share API> # permissions-policy> |
浏览器兼容性
Loading…