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

Function looksLikeTrackingIframe

src/iframe-helper.js:499–507  ·  view source on GitHub ↗
(element)

Source from the content-addressed store, hash-verified

497 * @return {boolean}
498 */
499export function looksLikeTrackingIframe(element) {
500 const {height, width} = element.getLayoutSize();
501 // This heuristic is subject to change.
502 if (width > 10 || height > 10) {
503 return false;
504 }
505 // Iframe is not tracking iframe if open with user interaction
506 return !closestAncestorElementBySelector(element, '.i-amphtml-overlay');
507}
508
509// Most common ad sizes
510// Array of [width, height] pairs.

Callers 2

layoutCallbackMethod · 0.90

Calls 2

getLayoutSizeMethod · 0.45

Tested by

no test coverage detected