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

Function executeAfterWriteScript

3p/3p.js:120–125  ·  view source on GitHub ↗

* Run the function after all currently waiting sync scripts have been * executed. * @param {!Window} win * @param {function()} fn

(win, fn)

Source from the content-addressed store, hash-verified

118 * @param {function()} fn
119 */
120function executeAfterWriteScript(win, fn) {
121 const index = syncScriptLoads++;
122 win['__runScript' + index] = fn;
123 // eslint-disable-next-line no-useless-concat
124 win.document.write('<' + 'script>__runScript' + index + '()<' + '/script>');
125}
126
127/**
128 * Throws if the given src doesn't start with prefix(es).

Callers 1

writeScriptFunction · 0.85

Calls 1

writeMethod · 0.45

Tested by

no test coverage detected