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

Function getAmpCacheHref

validator/js/chromeextension/content_script.js:28–36  ·  view source on GitHub ↗

* Returns the AMP page href from an AMP Cache. Otherwise returns empty string. * * @return {string} * @private

()

Source from the content-addressed store, hash-verified

26 * @private
27 */
28function getAmpCacheHref() {
29 for (const index in globals.ampCaches) {
30 const ampCache = globals.ampCaches[index];
31 if (ampCache.isAmpCache()) {
32 return ampCache.getAmpHref();
33 }
34 }
35 return '';
36}
37
38/**
39 * Determine if <link rel="amphtml" href="..."> exists in the page and

Callers 1

content_script.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected