third_party/subscriptions-project/swg.js
/**
 * Validate if is secure context. Returns null if context is secure, otherwise
 * return error message.
 *
 * See https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts
 *
 * @return {?string} null if current context is secure, otherwise return error
 * message.
 */
Validate if is secure context. Returns null if context is secure, otherwise
return error message.



@return {?string} null if current context is secure, otherwise return error
message.
Validate if is secure context . Returns null if context is secure otherwise return error message . @return { ?string } null if current context is secure otherwise return error message .
function validateSecureContext() {
  if (window.location.hostname.endsWith(Constants.TRUSTED_DOMAIN)) {
    return null;
  }
  if (window.isSecureContext === undefined) {
    return null;
  }
  return window.isSecureContext ?
      null :
      'Google Pay APIs should be called in secure context!';
}
function validateSecureContext ( ) { if ( window . location . hostname . endsWith ( Constants . TRUSTED_DOMAIN ) ) { return null ; } if ( window . isSecureContext === undefined ) { return null ; } return window . isSecureContext ? null : 'Google Pay APIs should be called in secure context!' ; }
Validate if is secure context.
Validate if is secure context .
// This is for local development. // Browser not support isSecureContext, figure out a way to validate this // for the unsupported browser.