Skip to content

Instantly share code, notes, and snippets.

@thyngster
Created February 27, 2024 21:18
Show Gist options
  • Save thyngster/271926b8e150482aa8c14d8184ed8814 to your computer and use it in GitHub Desktop.
Save thyngster/271926b8e150482aa8c14d8184ed8814 to your computer and use it in GitHub Desktop.
Privacy Sandbox Relevance & Measurement APIs Check
// ----------------------------------------------------------------------
// Privacy Sandbox Relevance & Measurement APIs Check
// ----------------------------------------------------------------------
const privacySandboxApisAvailability = {
topics: 'browsingTopics'in document ? true : false,
attributionReporting: document.featurePolicy.allowsFeature('attribution-reporting') ? true : false,
protectedAudience: 'runAdAuction'in navigator ? true : false,
fencedFrames: 'HTMLFencedFrameElement'in window ? true : false,
sharedStorage: 'sharedStorage'in window ? true : false,
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment