MCPcopy
hub / github.com/ampproject/amphtml / getConsentPolicy

Method getConsentPolicy

src/base-element.js:366–373  ·  view source on GitHub ↗

* Returns the consent policy id that this element should wait for before * buildCallback. * A `null` value indicates to not be blocked by consent. * Subclasses may override. * @return {?string}

()

Source from the content-addressed store, hash-verified

364 * @return {?string}
365 */
366 getConsentPolicy() {
367 let policyId = null;
368 if (this.element.hasAttribute('data-block-on-consent')) {
369 policyId =
370 this.element.getAttribute('data-block-on-consent') || 'default';
371 }
372 return policyId;
373 }
374
375 /**
376 * Intended to be implemented by subclasses. Tests whether the element

Callers 1

getConsentPolicy_Method · 0.45

Calls 1

getAttributeMethod · 0.80

Tested by

no test coverage detected