* @return {?PageConfig}
()
| 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 | |
| 811 | class JsonLdParser { |
no test coverage detected