Package com.oorian.html.elements.consts
Enum Class Sandbox
- All Implemented Interfaces:
Serializable,Comparable<Sandbox>,Constable
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:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionAllows form submission from the sandboxed iframe.Allows the iframe to lock the pointer (for games and interactive content).Allows the iframe to open popup windows.Allows the iframe content to be treated as being from the same origin.Allows the iframe to run JavaScript.Allows the iframe to navigate the top-level browsing context. -
Method Summary
Modifier and TypeMethodDescriptiongetValue()Gets the sandbox permission value for use in iframe elements.toString()static SandboxReturns the enum constant of this class with the specified name.static Sandbox[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
ALLOW_FORMS
Allows form submission from the sandboxed iframe. Without this flag, form submission is blocked. -
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
Allows the iframe to open popup windows. Without this flag, popup windows cannot be opened. -
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
Allows the iframe to run JavaScript. Without this flag, scripts are blocked from executing. -
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
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
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 nameNullPointerException- if the argument is null
-
getValue
Gets the sandbox permission value for use in iframe elements.- Returns:
- the string value used in HTML sandbox attribute.
-
toString
-