MCPcopy
hub / github.com/ampproject/amphtml / check

Method check

third_party/subscriptions-project/config.js:783–808  ·  view source on GitHub ↗

* @return {?PageConfig}

()

Source from the content-addressed store, hash-verified

781 * @return {?PageConfig}
782 */
783 check() {
784 if (!this.doc_.getBody()) {
785 // Wait until the whole `<head>` is parsed.
786 return null;
787 }
788
789 // Try to find product id.
790 const productId = getMetaTag(
791 this.doc_.getRootNode(),
792 'subscriptions-product-id'
793 );
794 if (!productId) {
795 return null;
796 }
797
798 // Is locked?
799 const accessibleForFree = getMetaTag(
800 this.doc_.getRootNode(),
801 'subscriptions-accessible-for-free'
802 );
803 const locked = !!(
804 accessibleForFree && accessibleForFree.toLowerCase() === 'false'
805 );
806
807 return new PageConfig(productId, locked);
808 }
809}
810
811class JsonLdParser {

Callers 2

runPrettifyFunction · 0.45
checkMethod · 0.45

Calls 3

getMetaTagFunction · 0.85
getBodyMethod · 0.45
getRootNodeMethod · 0.45

Tested by

no test coverage detected