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

Function iframeNestingDepth

ads/google/a4a/utils.js:397–406  ·  view source on GitHub ↗

* @param {!Window} win * @return {number}

(win)

Source from the content-addressed store, hash-verified

395 * @return {number}
396 */
397function iframeNestingDepth(win) {
398 let w = win;
399 let depth = 0;
400 while (w != w.parent && depth < 100) {
401 w = w.parent;
402 depth++;
403 }
404 devAssert(w == win.top);
405 return depth;
406}
407
408/**
409 * @param {!Window} win

Callers 1

googleBlockParametersFunction · 0.85

Calls 1

devAssertFunction · 0.90

Tested by

no test coverage detected