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

Method constructor

3p/iframe-transport-client.js:124–140  ·  view source on GitHub ↗

* @param {!Window} win * @param {!IframeMessagingClient} iframeMessagingClient * @param {string} creativeId The ID of the creative that the event * pertains to. * @param {string} vendor The 3p vendor name

(win, iframeMessagingClient, creativeId, vendor)

Source from the content-addressed store, hash-verified

122 * @param {string} vendor The 3p vendor name
123 */
124 constructor(win, iframeMessagingClient, creativeId, vendor) {
125 /** @private {!IframeMessagingClient} */
126 this.iframeMessagingClient_ = iframeMessagingClient;
127
128 /** @private @const {!Object} */
129 this.baseMessage_ = {creativeId, vendor};
130
131 /** @private {?function(string)} */
132 this.listener_ = null;
133
134 userAssert(
135 win['onNewContextInstance'] &&
136 typeof win['onNewContextInstance'] == 'function',
137 'Must implement onNewContextInstance in ' + win.location.href
138 );
139 win['onNewContextInstance'](this);
140 }
141
142 /**
143 * Registers a callback function to be called when an AMP analytics event

Callers

nothing calls this directly

Calls 1

userAssertFunction · 0.90

Tested by

no test coverage detected