MCPcopy Create free account
hub / github.com/ampproject/amphtml / ppstudio

Function ppstudio

ads/vendors/ppstudio.js:7–33  ·  view source on GitHub ↗
(global, data)

Source from the content-addressed store, hash-verified

5 * @param {!Object} data
6 */
7export function ppstudio(global, data) {
8 validateData(data, ['crid', 'width', 'height', 'holderScript'], []);
9
10 global._ppstudio = {
11 crid: data.crid,
12 width: data.width,
13 height: data.height,
14 holderScript: data.holderScript,
15 };
16
17 const e = global.document.createElement('script');
18 e.id = 'pps-script-' + data.crid;
19 e.setAttribute('data-width', data.width);
20 e.setAttribute('data-height', data.height);
21 e.setAttribute('data-click-url', '');
22 e.src = data.holderScript;
23 global.document.getElementById('c').appendChild(e);
24
25 const i = global.document.createElement('ins');
26 i.classList.add('ppstudio');
27 i.setAttribute('data-pps-target-id', 'cr-' + data.crid);
28 global.document.getElementById('c').appendChild(i);
29
30 loadScript(global, 'https://ads-cdn.tenmax.io/code/ppstudio.js', () => {
31 global.context.renderStart();
32 });
33}

Callers

nothing calls this directly

Calls 6

validateDataFunction · 0.90
loadScriptFunction · 0.90
renderStartMethod · 0.80
setAttributeMethod · 0.45
getElementByIdMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected