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

      • isAsyncScriptTag

        public static boolean isAsyncScriptTag​(ParsedHtmlTag tag)
        Tests if a tag is an async script tag.
        Parameters:
        tag - to test
        Returns:
        true iff a tag is an async script tag.
      • validateScriptSrcAttr

        public static void validateScriptSrcAttr​(@Nonnull
                                                 ParsedHtmlTag tag,
                                                 @Nonnull
                                                 dev.amp.validator.ValidatorProtos.TagSpec tagSpec,
                                                 @Nonnull
                                                 Context context,
                                                 @Nonnull
                                                 dev.amp.validator.ValidatorProtos.ValidationResult.Builder result)
        Validates that LTS is used for either all script sources or none.
        Parameters:
        tag - tag
        tagSpec - the spec to check against
        context - global context
        result - record to update