(element, policyId = 'default')
| 63 | * @return {!Promise<?Object|undefined>} |
| 64 | */ |
| 65 | export function getConsentMetadata(element, policyId = 'default') { |
| 66 | // Return the stored consent metadata. |
| 67 | return Services.consentPolicyServiceForDocOrNull(element).then( |
| 68 | (consentPolicy) => { |
| 69 | if (!consentPolicy) { |
| 70 | return null; |
| 71 | } |
| 72 | return consentPolicy.getConsentMetadataInfo( |
| 73 | /** @type {string} */ (policyId) |
| 74 | ); |
| 75 | } |
| 76 | ); |
| 77 | } |
| 78 | |
| 79 | /** |
| 80 | * Returns a set of consent values to forward to a 3rd party (like an iframe). |
no test coverage detected