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

Function adopt

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

Source from the content-addressed store, hash-verified

334 * @return {!Promise}
335 */
336export function adopt(global) {
337 return adoptShared(global, (global) => {
338 // Shared runtimes variables between both multi-doc and single-doc pages
339 adoptServicesAndResources(global);
340
341 return waitForBodyOpenPromise(global.document).then(() => {
342 // Ensure that all declared extensions are marked and stubbed.
343 stubElementsForDoc(global.AMP.ampdoc);
344 });
345 });
346}
347
348/**
349 * Applies the runtime to a given global scope for a single-doc mode.

Callers 6

test-runtime.jsFile · 0.90
amp-inabox.jsFile · 0.90
test-toolbar.jsFile · 0.90
setupMethod · 0.90

Calls 5

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

Tested by

no test coverage detected