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

Function adoptMultiDocDeps

src/runtime.js:399–407  ·  view source on GitHub ↗

* Adopt MultiDocManager dependencies * @param {!Window} global Global scope to adopt.

(global)

Source from the content-addressed store, hash-verified

397 * @param {!Window} global Global scope to adopt.
398 */
399function adoptMultiDocDeps(global) {
400 global.AMP.installAmpdocServices = installAmpdocServices.bind(null);
401 if (mode.isEsm()) {
402 const style = global.document.querySelector('style[amp-runtime]');
403 global.AMP.combinedCss = style ? style.textContent : '';
404 } else {
405 global.AMP.combinedCss = ampDocCss + ampSharedCss;
406 }
407}
408
409/**
410 * Applies the runtime to a given global scope for shadow mode.

Callers 2

adoptWithMultidocDepsFunction · 0.85
adoptShadowModeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected