History extension type
The History
interface of the History API
allows manipulation of the
browser session history, that is the pages visited in the tab or frame
that the current page is loaded in.
There is only one instance of history
(It is a singleton.) accessible
via the global object Window.history.
Note: This interface is only available on the main thread (Window). It cannot be accessed in Worker or Worklet contexts.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- length → int
-
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scrollRestoration ↔ ScrollRestoration
-
getter/setter pair
- state → JSAny?
-
no setter
Methods
-
back(
) → void -
The
back()
method of the History interface causes the browser to move back one page in the session history. -
forward(
) → void -
The
forward()
method of the History interface causes the browser to move forward one page in the session history. It has the same effect as calling History.go. -
go(
[int delta]) → void -
The
go()
method of the History interface loads a specific page from the session history. You can use it to move forwards and backwards through the history depending on the value of a parameter. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pushState(
JSAny? data, String unused, [String? url]) → void -
The
pushState()
method of the History interface adds an entry to the browser's session history stack. -
replaceState(
JSAny? data, String unused, [String? url]) → void -
The
replaceState()
method of the History interface modifies the current history entry, replacing it with the state object and URL passed in the method parameters. This method is particularly useful when you want to update the state object or URL of the current history entry in response to some user action. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited