src/impression.js
/**
 * Emit a HTTP request to a destination defined on the incoming URL.
 * Launched for trusted viewer. Otherwise guarded by experiment.
 * @param {!Window} win
 */
Emit a HTTP request to a destination defined on the incoming URL.
Launched for trusted viewer. Otherwise guarded by experiment.
@param {!Window} win
Emit a HTTP request to a destination defined on the incoming URL . Launched for trusted viewer . Otherwise guarded by experiment . @param { !Window } win
function maybeTrackImpression(win) {
  let resolveImpression;
  trackImpressionPromise = new Promise(resolve => {
    resolveImpression = resolve;
  });
  const viewer = Services.viewerForDoc(win.document);
  viewer.isTrustedViewer().then(isTrusted => {
    if (!isTrusted && !isExperimentOn(win, 'alp')) {
      resolveImpression();
      return;
    }
    trackImpressionFromClickParam(win, viewer, resolveImpression);
  });
}
function maybeTrackImpression ( win ) { let resolveImpression ; trackImpressionPromise = new Promise ( resolve => { resolveImpression = resolve ; } ) ; const viewer = Services . viewerForDoc ( win . document ) ; viewer . isTrustedViewer ( ) . then ( isTrusted => { if ( ! isTrusted && ! isExperimentOn ( win , 'alp' ) ) { resolveImpression ( ) ; return ; } trackImpressionFromClickParam ( win , viewer , resolveImpression ) ; } ) ; }
Emit a HTTP request to a destination defined on the incoming URL.
Emit a HTTP request to a destination defined on the incoming URL .
// Currently this feature is launched for trusted viewer, but still // experiment guarded for all AMP docs.