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

Method observeIntersection

3p/ampcontext.js:175–183  ·  view source on GitHub ↗

* Send message to runtime to start sending intersection messages. * @param {function(Array )} callback Function to call every time we * receive an intersection message. * @return {function()} that when called stops triggering the callback * every time we receive an inters

(callback)

Source from the content-addressed store, hash-verified

173 * every time we receive an intersection message.
174 */
175 observeIntersection(callback) {
176 return this.client_.makeRequest(
177 MessageType_Enum.SEND_INTERSECTIONS,
178 MessageType_Enum.INTERSECTION,
179 (intersection) => {
180 callback(intersection['changes']);
181 }
182 );
183 }
184
185 /**
186 * Requests HTML snippet from the parent window.

Callers 15

test-amp-ad-3p.jsFile · 0.80
kixerFunction · 0.80
taboolaFunction · 0.80
conativeFunction · 0.80
sspFunction · 0.80
colombiaFunction · 0.80
colombiafeedFunction · 0.80
revcontentFunction · 0.80
loadAdWhenViewedFunction · 0.80
nativoFunction · 0.80
mediaadFunction · 0.80

Calls 2

makeRequestMethod · 0.80
callbackFunction · 0.50

Tested by

no test coverage detected