third_party/subscriptions-project/config.js
/**
   * Extracts page config from Microdata in the DOM
   * @return {?PageConfig} PageConfig found
   */
Extracts page config from Microdata in the DOM
@return {?PageConfig} PageConfig found
Extracts page config from Microdata in the DOM @return { ?PageConfig } PageConfig found
tryExtractConfig_() {
    let config = this.getPageConfig_();
    if (config) {
      return config;
    }
    const nodeList = Array.prototype.slice
      .call(this.doc_.getRootNode().querySelectorAll('[itemscope][itemtype]'))
      .filter((node) =>
        this.checkType_.checkString(
          node.getAttribute('itemtype'),
          ALLOWED_TYPES
        )
      );
    for (let i = 0; nodeList[i] && config == null; i++) {
      const element = nodeList[i];
      if (this.access_ == null) {
        this.access_ = this.discoverAccess_(element);
      }
      if (!this.productId_) {
        this.productId_ = this.discoverProductId_(element);
      }
      config = this.getPageConfig_();
    }
    return config;
  }
tryExtractConfig_ ( ) { let config = this . getPageConfig_ ( ) ; if ( config ) { return config ; } const nodeList = Array . prototype . slice . call ( this . doc_ . getRootNode ( ) . querySelectorAll ( '[itemscope][itemtype]' ) ) . filter ( ( node ) => this . checkType_ . checkString ( node . getAttribute ( 'itemtype' ) , ALLOWED_TYPES ) ) ; for ( let i = 0 ; nodeList [ i ] && config == null ; i ++ ) { const element = nodeList [ i ] ; if ( this . access_ == null ) { this . access_ = this . discoverAccess_ ( element ) ; } if ( ! this . productId_ ) { this . productId_ = this . discoverProductId_ ( element ) ; } config = this . getPageConfig_ ( ) ; } return config ; }
Extracts page config from Microdata in the DOM
 @return {?PageConfig} PageConfig found
Extracts page config from Microdata in the DOM @return { ?PageConfig } PageConfig found
// Grab all the nodes with an itemtype and filter for our allowed types