third_party/subscriptions-project/swg.js
/**
 * @return {boolean} true if this version of Chrome supports PaymentRequest.
 */
@return {boolean} true if this version of Chrome supports PaymentRequest.
@return { boolean } true if this version of Chrome supports PaymentRequest .
function chromeSupportsPaymentRequest() {
  const isOpera = window.navigator.userAgent.indexOf('OPR/') != -1;
  if (isOpera) {
    return false;
  }
  if (chromeSupportsPaymentHandler()) {
    return true;
  }
  const androidPlatform = window.navigator.userAgent.match(/Android/i);
  const chromeVersion = window.navigator.userAgent.match(/Chrome\/([0-9]+)\./i);
  return androidPlatform != null && 'PaymentRequest' in window &&
      window.navigator.vendor == 'Google Inc.' && chromeVersion != null &&
      Number(chromeVersion[1]) >= 59;
}
function chromeSupportsPaymentRequest ( ) { const isOpera = window . navigator . userAgent . indexOf ( 'OPR/' ) != - 1 ; if ( isOpera ) { return false ; } if ( chromeSupportsPaymentHandler ( ) ) { return true ; } const androidPlatform = window . navigator . userAgent . match ( / Android / i ) ; const chromeVersion = window . navigator . userAgent . match ( / Chrome\/([0-9]+)\. / i ) ; return androidPlatform != null && 'PaymentRequest' in window && window . navigator . vendor == 'Google Inc.' && chromeVersion != null && Number ( chromeVersion [ 1 ] ) >= 59 ; }
@return {boolean} true if this version of Chrome supports PaymentRequest.
@return { boolean } true if this version of Chrome supports PaymentRequest .
// Opera uses chrome as rendering engine and sends almost the exact same // user agent as chrome thereby fooling us on android. // Make sure skipping PaymentRequest UI when only one PaymentMethod is // supported (starts on Google Chrome 59).