/
githubmirror
/
amphtml
Обзор
Документация
Войти
/
githubmirror
/
amphtml
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/utils/privacy-sandbox-utils.js
28 строк
795 B
Corey E
✨ Resolve ATTRIBUTION_REPORTING_STATUS in attributionsrc/src for generated pixels (#39132)
26 июн 2023, 20:36
Не верифицирован
26 июн 2023, 20:36
32a1ac2
Код
Авторство
О чём код?
/** * Determine if `attribution-reporting` API is available in browser. * @param {!Document} doc * @return {boolean} */ export function isAttributionReportingAvailable(doc) { return doc.featurePolicy?.features().includes('attribution-reporting'); } /** * Determine if `attribution-reporting` API is allowed in current context. * @param {!Document} doc * @return {boolean} */ export function isAttributionReportingAllowed(doc) { return doc.featurePolicy?.allowedFeatures().includes('attribution-reporting'); } /** * Indicates the status of the `attribution-reporting` API. * @enum */ export const AttributionReportingStatus = { ATTRIBUTION_DATA_UNSPECIFIED: 0, ATTRIBUTION_MACRO_PRESENT: 4, ATTRIBUTION_DATA_PRESENT: 5, ATTRIBUTION_DATA_PRESENT_AND_POLICY_ENABLED: 6, };