Module org.htmlunit

Class History

java.lang.Object
org.htmlunit.corejs.javascript.SlotMapOwner<org.htmlunit.corejs.javascript.Scriptable>
org.htmlunit.corejs.javascript.ScriptableObject
org.htmlunit.javascript.HtmlUnitScriptable
org.htmlunit.javascript.host.History
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 History extends HtmlUnitScriptable
JavaScript host object for the client's browsing history.
Author:
Mike Bowler, Chris Erskine, Daniel Gredler, Ahmed Ashour, Ronald Brill, Adam Afeltowicz, Lai Quang Duong
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.htmlunit.corejs.javascript.ScriptableObject

    org.htmlunit.corejs.javascript.ScriptableObject.DescriptorInfo, org.htmlunit.corejs.javascript.ScriptableObject.KeyComparator, org.htmlunit.corejs.javascript.ScriptableObject.LambdaGetterFunction, org.htmlunit.corejs.javascript.ScriptableObject.LambdaSetterFunction
  • Field Summary

    Fields inherited from class org.htmlunit.corejs.javascript.ScriptableObject

    CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST

    Fields inherited from class org.htmlunit.corejs.javascript.SlotMapOwner

    isSealed

    Fields inherited from interface org.htmlunit.corejs.javascript.Scriptable

    NOT_FOUND
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Navigates one step back in the session history.
    void
    Navigates one step forward in the session history.
    int
    Returns the length property.
    Returns the scrollRestoration property.
    Returns the state property.
    void
    go(int relativeIndex)
    Navigates by the given number of steps relative to the current position in the session history.
    void
    Creates an instance of this object.
    void
    pushState(Object object, String title, Object url)
    Pushes a new state onto the session history stack.
    void
    replaceState(Object object, String title, Object url)
    Replaces the current history entry with the given state.
    void
    setScrollRestoration(String scrollRestoration)
    Sets the scrollRestoration property.

    Methods inherited from class org.htmlunit.corejs.javascript.ScriptableObject

    applyDescriptorToAttributeBitset, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkNotSealed, checkPropertyChangeForSlot, checkPropertyChangeForSlot, checkPropertyDefinition, checkPropertyDefinition, checkSlotRemoval, defineBuiltinProperty, defineBuiltinProperty, defineBuiltInProperty, defineBuiltInProperty, defineBuiltInProperty, defineBuiltInProperty, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, delete, deleteProperty, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, ensureScriptableObjectButNotSymbol, ensureSymbolScriptable, ensureType, get, get, getAllIds, getAncestor, getArrayPrototype, getClassPrototype, getClassPrototype, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGeneratorFunctionPrototype, getGetterOrSetter, getGetterOrSetter, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getProperty, getProperty, getProperty, getPropertyIds, getPrototype, getSuperProperty, getSuperProperty, getSuperProperty, getThis, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, hasProperty, hasProperty, hasProperty, hasProperty, isAccessorDescriptor, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGenericDescriptor, isGetterOrSetter, isGetterOrSetter, isTrue, preventExtensions, put, put, putConst, putConstProperty, putConstProperty, putOwnProperty, putOwnProperty, putOwnProperty, putProperty, putProperty, putProperty, putProperty, putSuperProperty, putSuperProperty, putSuperProperty, querySlot, redefineProperty, redefineProperty, sameValue, sealObject, setCommonDescriptorProperties, setExternalArrayData, setGetterOrSetter, setParentScope, setPrototype, size

    Methods inherited from class org.htmlunit.corejs.javascript.SlotMapOwner

    associateValue, checkNotSealed, copyAssociatedValue, createSlotMap, defineProperty, defineProperty, get, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getAttributes, getIds, has, has, isSealed, readMaps, setAttributes, setAttributes, setAttributes, setAttributes, setAttributes, writeMaps

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.htmlunit.corejs.javascript.Scriptable

    get, getIds, has, has

    Methods inherited from interface org.htmlunit.corejs.javascript.SymbolScriptable

    get, has
  • Constructor Details

    • History

      public History()
  • Method Details

    • jsConstructor

      public void jsConstructor()
      Creates an instance of this object.
    • getLength

      public int getLength()
      Returns the length property.
      Returns:
      the number of entries in the session history
    • getState

      public Object getState()
      Returns the state property.
      Returns:
      the current history state object
    • back

      public void back()
      Navigates one step back in the session history.
    • forward

      public void forward()
      Navigates one step forward in the session history.
    • go

      public void go(int relativeIndex)
      Navigates by the given number of steps relative to the current position in the session history.
      Parameters:
      relativeIndex - the relative number of steps to navigate (positive or negative)
    • replaceState

      public void replaceState(Object object, String title, Object url)
      Replaces the current history entry with the given state.
      Parameters:
      object - the new state object
      title - the title (currently ignored by most browsers)
      url - an optional new URL for the history entry
    • pushState

      public void pushState(Object object, String title, Object url)
      Pushes a new state onto the session history stack.
      Parameters:
      object - the new state object
      title - the title (currently ignored by most browsers)
      url - an optional new URL for the new history entry
    • getScrollRestoration

      public String getScrollRestoration()
      Returns the scrollRestoration property.
      Returns:
      the scrollRestoration property
    • setScrollRestoration

      public void setScrollRestoration(String scrollRestoration)
      Sets the scrollRestoration property.
      Parameters:
      scrollRestoration - the new value; either "auto" or "manual"