Class BeforeUnloadEvent

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.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:
    Mozilla Developer Network, MSDN, Serialized Form
    • Field Detail

      • returnValue_

        private java.lang.Object returnValue_
    • Constructor Detail

      • BeforeUnloadEvent

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

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

      • jsConstructor

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

        public void initEvent​(java.lang.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 java.lang.Object getReturnValueDefault​(BrowserVersion browserVersion)
      • isBeforeUnloadMessageSet

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

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

        public void setReturnValue​(java.lang.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​(java.lang.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