Class PluginTypesDirective

java.lang.Object
org.htmlunit.csp.Directive
org.htmlunit.csp.directive.PluginTypesDirective

public class PluginTypesDirective extends Directive
Represents the (deprecated) plugin-types CSP directive.

The plugin-types directive restricts the set of plugins that can be embedded via <object>, <embed>, or <applet> by specifying an allow-list of media types. Note that this directive has been deprecated and is no longer supported by most browsers.

Author:
Salvation Team
See Also:
  • Constructor Details

    • PluginTypesDirective

      public PluginTypesDirective(List<String> values, Directive.DirectiveErrorConsumer errors)
      Parses a plugin-types directive from the given list of media-type values.

      Each token is parsed as a media type (type/subtype). Invalid tokens and duplicates are reported through the supplied errors consumer. Note that empty lists are allowed per w3c/webappsec-csp#374.

      Parameters:
      values - the raw string values for this directive
      errors - consumer that receives parsing errors and warnings
  • Method Details

    • getMediaTypes

      public List<MediaType> getMediaTypes()
      Returns an unmodifiable list of the media types allowed by this directive.
      Returns:
      the list of parsed MediaType values