Class BeforeUnloadEvent

java.lang.Object
org.htmlunit.corejs.javascript.ScriptableObject
org.htmlunit.javascript.HtmlUnitScriptable
org.htmlunit.javascript.host.event.Event
org.htmlunit.javascript.host.event.BeforeUnloadEvent
All Implemented Interfaces:
Serializable, Cloneable, org.htmlunit.corejs.javascript.ConstProperties, org.htmlunit.corejs.javascript.debug.DebuggableObject, org.htmlunit.corejs.javascript.Scriptable, org.htmlunit.corejs.javascript.SymbolScriptable

public class BeforeUnloadEvent extends Event
JavaScript object representing the BeforeUnloadEvent.
See Also:
  • Field Details

    • returnValue_

      private Object returnValue_
  • Constructor Details

    • BeforeUnloadEvent

      public BeforeUnloadEvent()
      Creates a new event instance.
    • BeforeUnloadEvent

      public BeforeUnloadEvent(DomNode domNode, String type)
      Creates a new event instance.
      Parameters:
      domNode - the DOM node that triggered the event
      type - the event type
  • Method Details

    • jsConstructor

      public void jsConstructor()
      The JavaScript constructor. It seems it is not possible to do it from JavaScript code.
    • initEvent

      public void initEvent(String type, boolean bubbles, boolean cancelable)
      Description copied from class: Event
      Initializes this event.
      Overrides:
      initEvent in class Event
      Parameters:
      type - the event type
      bubbles - whether or not the event should bubble
      cancelable - whether or not the event the event should be cancelable
    • getReturnValueDefault

      private static Object getReturnValueDefault(BrowserVersion browserVersion)
    • isBeforeUnloadMessageSet

      public boolean isBeforeUnloadMessageSet()
      Returns:
      true if returnValue holds the beforeunload message
    • getReturnValue

      public Object getReturnValue()
      Overrides:
      getReturnValue in class Event
      Returns:
      the return value associated with the event
    • setReturnValue

      public void setReturnValue(Object returnValue)
      Sets the return value associated with the event.
      Overrides:
      setReturnValue in class Event
      Parameters:
      returnValue - the return value associated with the event
    • handlePropertyHandlerReturnValue

      void handlePropertyHandlerReturnValue(Object returnValue)
      Description copied from class: Event
      Handles the return values of property handlers.
      Overrides:
      handlePropertyHandlerReturnValue in class Event
      Parameters:
      returnValue - the return value returned by the property handler