MCPcopy Create free account
hub / github.com/ampproject/amphtml / installAmpAdStylesPromise

Function installAmpAdStylesPromise

testing/describes.js:935–944  ·  view source on GitHub ↗

* @param {!Window} win

(win)

Source from the content-addressed store, hash-verified

933 * @param {!Window} win
934 */
935function installAmpAdStylesPromise(win) {
936 if (win.document.querySelector('style[amp-extension="amp-ad"]')) {
937 // Already installed.
938 return;
939 }
940 const style = document.createElement('style');
941 style.setAttribute('amp-extension', 'amp-ad');
942 style./*OK*/ textContent = CSS;
943 win.document.head.appendChild(style);
944}
945
946/**
947 * Creates a custom element without registration.

Callers 1

setupMethod · 0.85

Calls 1

setAttributeMethod · 0.45

Tested by

no test coverage detected