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

Function getParentWindowFrameElement

src/service-helpers.js:287–298  ·  view source on GitHub ↗
(node, opt_topWin)

Source from the content-addressed store, hash-verified

285 * @return {?HTMLIFrameElement}
286 */
287export function getParentWindowFrameElement(node, opt_topWin) {
288 const childWin = (node.ownerDocument || node).defaultView;
289 const topWin = opt_topWin || getTopWindow(childWin);
290 if (childWin && childWin != topWin && getTopWindow(childWin) == topWin) {
291 try {
292 return /** @type {?HTMLIFrameElement} */ (childWin.frameElement);
293 } catch (e) {
294 // Ignore the error.
295 }
296 }
297 return null;
298}
299
300/**
301 * @param {!Node|!./service/ampdoc-impl.AmpDoc} nodeOrDoc

Callers 9

test-service.jsFile · 0.90
getAmpAdResourceIdFunction · 0.90
getAmpDocIfAvailableMethod · 0.90
getLayoutRectMethod · 0.90
getClientRectAsyncMethod · 0.90
createVisibilityManagerFunction · 0.90
findRoot_Method · 0.90
buildCallbackMethod · 0.90

Calls 1

getTopWindowFunction · 0.85

Tested by

no test coverage detected