History

Overview

History is a class in Aspose.Html FOSS for Python.

In-memory session history for a Window.

This class provides 6 methods for working with History objects in Python programs. Available methods include: __init__, back, forward, go, push_state, replace_state. All public members are accessible to any Python application after installing the Aspose.Html FOSS for Python package. Properties: length, scroll_restoration, state.

Properties

NameTypeAccessDescription
lengthintReadGets the length.
stateobject | NoneReadGets the state.
scroll_restorationstrRead/WriteGets or sets the scroll restoration.

Methods

SignatureDescription
__init__(window: "Window")Calls init(window) on this History instance.
push_state(state: object, title: str, url: str | None)Push a new session-history entry.
replace_state(state: object, title: str, url: str | None)Replace the current session-history entry.
go(delta: int)Move by delta in session history and dispatch popstate on traversal.
back()Equivalent to go(-1).
forward()Equivalent to go(1).

See Also