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

Function adoptWithMultidocDeps

src/runtime.js:354–367  ·  view source on GitHub ↗
(global)

Source from the content-addressed store, hash-verified

352 * @return {!Promise}
353 */
354export function adoptWithMultidocDeps(global) {
355 return adoptShared(global, (global) => {
356 // Shared runtimes variables between both multi-doc and single-doc pages
357 adoptServicesAndResources(global);
358
359 // Dependencies to the MultiDocManager
360 adoptMultiDocDeps(global);
361
362 return waitForBodyOpenPromise(global.document).then(() => {
363 // Ensure that all declared extensions are marked and stubbed.
364 stubElementsForDoc(global.AMP.ampdoc);
365 });
366 });
367}
368
369/**
370 * Adopt shared runtimes variables between both multi-doc and single-doc pages

Callers 2

bootstrapFunction · 0.90
resetTestingStateFunction · 0.90

Calls 6

waitForBodyOpenPromiseFunction · 0.90
stubElementsForDocFunction · 0.90
adoptSharedFunction · 0.85
adoptMultiDocDepsFunction · 0.85
thenMethod · 0.45

Tested by

no test coverage detected