MCPcopy
hub / github.com/ampproject/amphtml / maybeSwitchToMinifiedJs

Function maybeSwitchToMinifiedJs

testing/iframe.js:618–635  ·  view source on GitHub ↗
(html)

Source from the content-addressed store, hash-verified

616 * @return {string}
617 */
618export function maybeSwitchToMinifiedJs(html) {
619 if (window.ampTestRuntimeConfig.useMinifiedJs) {
620 return (
621 html
622 // Main JS
623 .replace(/\/dist\/amp\.js/g, '/dist/v0.js')
624 // Inabox
625 .replace(/\/dist\/amp-inabox/g, '/dist/amp4ads-v0')
626 // Extensions
627 .replace(/\.max\.js/g, '.js')
628 // 3p html binary
629 .replace(/\.max\.html/g, '.html')
630 // 3p path
631 .replace(/dist\.3p\/current\//g, 'dist.3p/current-min/')
632 );
633 }
634 return html;
635}
636
637class MessageReceiver {
638 /**

Callers 2

createFixtureIframeFunction · 0.85

Calls 1

replaceMethod · 0.45

Tested by

no test coverage detected