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

Function waitForJsInIframe

extensions/amp-iframe/0.1/test/test-amp-iframe.js:93–102  ·  view source on GitHub ↗
(opt_ranJs = 1, opt_timeout = 300)

Source from the content-addressed store, hash-verified

91 }
92
93 function waitForJsInIframe(opt_ranJs = 1, opt_timeout = 300) {
94 return poll(
95 'waiting for JS to run',
96 () => {
97 return ranJs >= opt_ranJs;
98 },
99 undefined,
100 opt_timeout
101 );
102 }
103
104 function waitForAmpIframeLayoutPromise(doc, ampIframe) {
105 const viewport = Services.viewportForDoc(doc);

Callers 1

test-amp-iframe.jsFile · 0.85

Calls 1

pollFunction · 0.90

Tested by

no test coverage detected