Module org.htmlunit

Class StorageEvent

java.lang.Object
org.htmlunit.corejs.javascript.SlotMapOwner<org.htmlunit.corejs.javascript.Scriptable>
org.htmlunit.corejs.javascript.ScriptableObject
All Implemented Interfaces:
Serializable, Cloneable, org.htmlunit.corejs.javascript.ConstProperties<org.htmlunit.corejs.javascript.Scriptable>, org.htmlunit.corejs.javascript.debug.DebuggableObject, org.htmlunit.corejs.javascript.PropHolder<org.htmlunit.corejs.javascript.Scriptable>, org.htmlunit.corejs.javascript.Scriptable, org.htmlunit.corejs.javascript.SymbolScriptable

public class StorageEvent extends Event
A JavaScript object for StorageEvent.
Author:
Ahmed Ashour, Ronald Brill
See Also:
  • Constructor Details

    • StorageEvent

      public StorageEvent()
  • Method Details

    • jsConstructor

      public void jsConstructor(String type, org.htmlunit.corejs.javascript.ScriptableObject details)
      JavaScript constructor.
      Overrides:
      jsConstructor in class Event
      Parameters:
      type - the event type
      details - the event details (optional)
    • initStorageEvent

      public void initStorageEvent(String type, boolean bubbles, boolean cancelable, String key, String oldValue, String newValue, String url, Storage storageArea)
      Initializes this storage event.
      Parameters:
      type - the event type
      bubbles - whether the event bubbles
      cancelable - whether the event is cancelable
      key - the changed key or null if the storage was cleared
      oldValue - the old value or null
      newValue - the new value or null
      url - the URL of the document whose storage was changed
      storageArea - the affected storage
    • jsInitStorageEvent

      public static void jsInitStorageEvent(org.htmlunit.corejs.javascript.Context context, org.htmlunit.corejs.javascript.VarScope scope, org.htmlunit.corejs.javascript.Scriptable thisObj, Object[] args, org.htmlunit.corejs.javascript.Function function)
      Implementation of the JavaScript function initStorageEvent(type, bubbles, cancelable, key, oldValue, newValue, url, storageArea).
      Parameters:
      context - the context
      scope - the scope
      thisObj - this object
      args - the arguments
      function - the function
    • getKey

      public String getKey()
      Returns the key that was changed.
      Returns:
      the key or null if the storage was cleared
    • getOldValue

      public String getOldValue()
      Returns the old value of the changed key.
      Returns:
      the old value or null
    • getNewValue

      public String getNewValue()
      Returns the new value of the changed key.
      Returns:
      the new value or null
    • getUrl

      public String getUrl()
      Returns the URL of the document whose storage was changed.
      Returns:
      the URL
    • getStorageArea

      public Storage getStorageArea()
      Returns the storage that was affected.
      Returns:
      the storage or null