src/validator-integration.js
/**
 * Triggers validation for the current document if there is a script in the
 * page that has a "development" attribute.
 *
 * @param {!Window} win Destination window for the new element.
 */
Triggers validation for the current document if there is a script in the
page that has a "development" attribute.

@param {!Window} win Destination window for the new element.
Triggers validation for the current document if there is a script in the page that has a " development " attribute . @param { !Window } win Destination window for the new element .
function maybeValidate(win) {
  const filename = win.location.href;
  if (startsWith(filename, 'about:')) {  
    return;
  }
  if (getMode().development) {
    loadScript(win.document, `${urls.cdn}/v0/validator.js`).then(() => {
      amp.validator.validateUrlAndLog(
          filename, win.document, getMode().filter);
    });
  } else if (getMode().examiner) {
    loadScript(win.document, `${urls.cdn}/examiner.js`);
  }
}
function maybeValidate ( win ) { const filename = win . location . href ; if ( startsWith ( filename , 'about:' ) ) { return ; } if ( getMode ( ) . development ) { loadScript ( win . document , ` ${ urls . cdn } ` ) . then ( ( ) => { amp . validator . validateUrlAndLog ( filename , win . document , getMode ( ) . filter ) ; } ) ; } else if ( getMode ( ) . examiner ) { loadScript ( win . document , ` ${ urls . cdn } ` ) ; } }
Triggers validation for the current document if there is a script in the
 page that has a "development" attribute.
Triggers validation for the current document if there is a script in the page that has a " development " attribute .
// Should only happen in tests. /* global amp: false */