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

Function extractScriptSrc

test/unit/test-friendly-iframe-embed.js:706–713  ·  view source on GitHub ↗
(html)

Source from the content-addressed store, hash-verified

704 });
705
706 function extractScriptSrc(html) {
707 const beg = html.indexOf('script-src');
708 const end = html.indexOf(';', beg + 1);
709 if (beg == -1 || end == -1) {
710 throw new Error('script-src not found');
711 }
712 return html.substring(beg + 'script-src'.length, end).trim();
713 }
714
715 it('should install base', () => {
716 const html = mergeHtmlForTesting(spec);

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected