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

Method isExtensionScriptRequired_

src/service/extensions-impl.js:619–633  ·  view source on GitHub ↗

* Determine the need to add amp extension script to document. * @param {string} extensionId * @param {string} version * @param {!ExtensionHolderDef} holder * @return {boolean} * @private

(extensionId, version, holder)

Source from the content-addressed store, hash-verified

617 * @private
618 */
619 isExtensionScriptRequired_(extensionId, version, holder) {
620 if (holder.loaded || holder.error) {
621 return false;
622 }
623 if (holder.scriptPresent === undefined) {
624 const scriptsInHead = getExtensionScripts(
625 this.win,
626 extensionId,
627 version,
628 holder.latest
629 );
630 holder.scriptPresent = scriptsInHead.length > 0;
631 }
632 return !holder.scriptPresent;
633 }
634}
635
636/**

Callers 1

Calls 1

getExtensionScriptsFunction · 0.90

Tested by

no test coverage detected