Permissions-Policy: attribution-reporting
Deprecated
To be removed
This feature is pending removal from browsers. Using it now may lead to broken functionality in future updates. Following the announcement that Chrome will maintain its current approach to third-party cookies, Chrome decided to withdraw certain Privacy Sandbox features including the attribution reporting API. >
HTTP Permissions-Policy 标头的 attribution-reporting 指令控制当前文档是否被允许使用 Attribution Reporting API。
具体来说,如果定义的策略阻止使用此特性:
- 不会进行后台
attributionsrc请求。 - 调用
XMLHttpRequest.setAttributionReporting()方法时会抛出异常。 - 当在
fetch()调用中包含attributionReporting选项时,会导致抛出异常。 - HTTP 响应中与文档相关的注册标头(
Attribution-Reporting-Register-Source和Attribution-Reporting-Register-Trigger)将被忽略。
语法
http
Permissions-Policy: attribution-reporting=<allowlist>;
<allowlist>-
允许使用该特性的来源列表。请参阅
Permissions-Policy> 语法了解更多详细信息。
默认策略
attribution-reporting 的默认允许列表为:*。