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

Method send

src/iframe-helper.js:474–484  ·  view source on GitHub ↗

* Sends a message to all subscribed windows. * @param {string} type Type of the message. * @param {!JsonObject} data Message payload.

(type, data)

Source from the content-addressed store, hash-verified

472 * @param {!JsonObject} data Message payload.
473 */
474 send(type, data) {
475 // Remove clients that have been removed from the DOM.
476 remove(this.clientWindows_, (client) => !client.win.parent);
477 postMessageToWindows(
478 this.iframe_,
479 this.clientWindows_,
480 type,
481 data,
482 this.is3p_
483 );
484 }
485
486 /**
487 * Destroys iframe.

Callers 15

getAmpConfigFunction · 0.45
amp4test.jsFile · 0.45
callbackFunction · 0.45
saveVariablesFunction · 0.45
runVariableSubstitutionFunction · 0.45
passthroughServeModeCdnFunction · 0.45
app.jsFile · 0.45
proxyToAmpProxyFunction · 0.45
analytics.jsFile · 0.45
xhrRequestFunction · 0.45
preconnectPolyfill_Method · 0.45

Calls 2

removeFunction · 0.90
postMessageToWindowsFunction · 0.85

Tested by

no test coverage detected