Class ExtensionsUtils


  • public final class ExtensionsUtils
    extends Object
    Utils to handle extension validation
    Author:
    nhant01, GeorgeLuo
    • Field Detail

      • EXTENSION_SCRIPT_NAMES

        public static final String[] EXTENSION_SCRIPT_NAMES
        list of extension script names
    • Method Detail

      • validateAmpScriptSrcAttr

        public static void validateAmpScriptSrcAttr​(@Nonnull
                                                    ParsedHtmlTag tag,
                                                    @Nonnull
                                                    String attrValue,
                                                    @Nonnull
                                                    dev.amp.validator.ValidatorProtos.TagSpec tagSpec,
                                                    @Nonnull
                                                    Context context,
                                                    @Nonnull
                                                    dev.amp.validator.ValidatorProtos.ValidationResult.Builder result)
        Validates the 'src' attribute for AMP JavaScript (Runtime and Extensions) script tags. This validates: - the script is using an AMP domain - the script path is valid (for extensions only, runtime uses attrSpec) - that the same script release version is used for all script sources
        Parameters:
        tag - tag
        attrValue - value
        tagSpec - the spec to check against
        context - global context
        result - record to update