* 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)
| 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 | /** |
no test coverage detected