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

Function detectNonAmpJs

src/error-reporting.js:662–673  ·  view source on GitHub ↗
(win)

Source from the content-addressed store, hash-verified

660 * @visibleForTesting
661 */
662export function detectNonAmpJs(win) {
663 if (!win.document) {
664 return false;
665 }
666 const scripts = win.document.querySelectorAll('script[src]');
667 for (let i = 0; i < scripts.length; i++) {
668 if (!isProxyOrigin(scripts[i].src.toLowerCase())) {
669 return true;
670 }
671 }
672 return false;
673}
674
675/**
676 * Resets accumulated error messages for testing

Callers 2

onErrorFunction · 0.85

Calls 1

isProxyOriginFunction · 0.90

Tested by

no test coverage detected