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

Function instrumentIframeWindow

3p/environment.js:133–142  ·  view source on GitHub ↗

* Installs a mutation observer in a window to look for iframes. * @param {!Element} node * @param {!Window} parent * @param {!Window} win

(node, parent, win)

Source from the content-addressed store, hash-verified

131 * @param {!Window} win
132 */
133function instrumentIframeWindow(node, parent, win) {
134 if (win.ampSeen) {
135 return;
136 }
137 const doc = win.document;
138 instrumentDocWrite(parent, win);
139 if (doc.body && doc.body.childNodes.length) {
140 manageWin(win);
141 }
142}
143
144/**
145 * Installs a mutation observer in a window to look for iframes.

Callers 1

maybeInstrumentsNodesFunction · 0.85

Calls 2

instrumentDocWriteFunction · 0.85
manageWinFunction · 0.85

Tested by

no test coverage detected