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

Method getConsentPolicy_

src/custom-element.js:1885–1903  ·  view source on GitHub ↗

* Get the consent policy to follow. * @return {?string}

()

Source from the content-addressed store, hash-verified

1883 * @return {?string}
1884 */
1885 getConsentPolicy_() {
1886 let policyId = this.getAttribute('data-block-on-consent');
1887 if (policyId === null) {
1888 if (shouldBlockOnConsentByMeta(this)) {
1889 policyId = 'default';
1890 this.setAttribute('data-block-on-consent', policyId);
1891 } else {
1892 // data-block-on-consent attribute not set
1893 return null;
1894 }
1895 }
1896 if (policyId == '' || policyId == 'default') {
1897 // data-block-on-consent value not set, up to individual element
1898 // Note: data-block-on-consent and data-block-on-consent='default' is
1899 // treated exactly the same
1900 return devAssert(this.impl_).getConsentPolicy();
1901 }
1902 return policyId;
1903 }
1904
1905 /**
1906 * Get the purpose consents that should be granted.

Callers 3

buildInternalMethod · 0.95

Calls 5

devAssertFunction · 0.90
getAttributeMethod · 0.80
setAttributeMethod · 0.45
getConsentPolicyMethod · 0.45

Tested by

no test coverage detected