MCPcopy Index your code
hub / github.com/ampproject/amphtml / requestResize

Method requestResize

3p/ampcontext.js:220–231  ·  view source on GitHub ↗

* Send message to runtime requesting to resize ad to height and width. * This is not guaranteed to succeed. All this does is make the request. * @param {number|undefined} width The new width for the ad we are requesting. * @param {number|undefined} height The new height for the ad we

(width, height, hasOverflow)

Source from the content-addressed store, hash-verified

218 * @return {Promise} Signify the success/failure of the request.
219 */
220 requestResize(width, height, hasOverflow) {
221 const requestId = this.nextResizeRequestId_++;
222 this.client_.sendMessage(MessageType_Enum.EMBED_SIZE, {
223 'id': requestId,
224 'width': width,
225 'height': height,
226 'hasOverflow': hasOverflow,
227 });
228 const deferred = new Deferred();
229 this.resizeIdToDeferred_[requestId] = deferred;
230 return deferred.promise;
231 }
232
233 /**
234 * Set up listeners to handle responses from request size.

Callers 15

getBeOpinionAsyncInitFunction · 0.80
updateDimensionsMethod · 0.80
embedlyFunction · 0.80
mathmlFunction · 0.80
test-amp-ad-3p.jsFile · 0.80
handleResizeFunction · 0.80
netletixFunction · 0.80
_4wmarketplaceFunction · 0.80
requestResizeInternalFunction · 0.80
adenzaFunction · 0.80
initPlayerFunction · 0.80

Calls 1

sendMessageMethod · 0.45

Tested by

no test coverage detected