Enum Class Sandbox

java.lang.Object
java.lang.Enum<Sandbox>
com.oorian.html.elements.consts.Sandbox
All Implemented Interfaces:
Serializable, Comparable<Sandbox>, Constable

public enum Sandbox extends Enum<Sandbox>
Enumeration defining sandbox restrictions for iframe elements. This enum provides type-safe constants for the iframe's "sandbox" attribute, which enables security restrictions on iframe content.
Since:
1.0
Version:
1.0
Author:
Marvin P. Warble Jr.
See Also:
  • Enum Constant Details

    • ALLOW_FORMS

      public static final Sandbox ALLOW_FORMS
      Allows form submission from the sandboxed iframe. Without this flag, form submission is blocked.
    • ALLOW_POINTER_LOCK

      public static final Sandbox ALLOW_POINTER_LOCK
      Allows the iframe to lock the pointer (for games and interactive content). Without this flag, pointer lock API is disabled.
    • ALLOW_POPUPS

      public static final Sandbox ALLOW_POPUPS
      Allows the iframe to open popup windows. Without this flag, popup windows cannot be opened.
    • ALLOW_SAME_ORIGIN

      public static final Sandbox ALLOW_SAME_ORIGIN
      Allows the iframe content to be treated as being from the same origin. Without this flag, iframe is treated as cross-origin (recommended for security).
    • ALLOW_SCRIPTS

      public static final Sandbox ALLOW_SCRIPTS
      Allows the iframe to run JavaScript. Without this flag, scripts are blocked from executing.
    • ALLOW_TOP_NAVIGATION

      public static final Sandbox ALLOW_TOP_NAVIGATION
      Allows the iframe to navigate the top-level browsing context. Without this flag, the iframe cannot change the parent page's location.
  • Method Details

    • values

      public static Sandbox[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Sandbox valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getValue

      public String getValue()
      Gets the sandbox permission value for use in iframe elements.
      Returns:
      the string value used in HTML sandbox attribute.
    • toString

      public String toString()
      Overrides:
      toString in class Enum<Sandbox>