History Class
https://html.spec.whatwg.org/multipage/nav-history-apis.html#the-history-interface. The session history is the joint session history of the top-level traversable (its entries and the ones of its child navigables). The documents of the other entries are not kept alive (there is no back/forward cache): a traversal to another document loads it again.
public sealed class HistoryRemarks
Each document has its own History object (https://html.spec.whatwg.org/multipage/nav-history-apis.html#doc-history): a navigation that reuses the window of an initial about:blank document gives it a new History object.
The state is structured-serialized by History.PushState and History.ReplaceState (by the script engine of the window, or, without a script engine, only the primitive values and the serializable platform objects can be serialized), and History.State is a deserialization of the state of the session history entry.
See also
Properties
| Name | Description |
|---|---|
| Length | https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-history-length |
| ScrollRestoration | https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-history-scroll-restoration |
| State | https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-history-state |
Length
History.cshttps://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-history-length
public uint Length { get; }Property value
See also
ScrollRestoration
History.cshttps://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-history-scroll-restoration
public ScrollRestoration ScrollRestoration { get; set; }State
History.cshttps://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-history-state
public object? State { get; }Property value
See also
Methods
| Name | Description |
|---|---|
| Back() | https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-history-back |
| Forward() | https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-history-forward |
| Go(int) | https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-history-go |
| PushState(object?, string, string?) | https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-history-pushstate |
| ReplaceState(object?, string, string?) | https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-history-replacestate |
Back()
History.cshttps://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-history-back
public void Back()Forward()
History.cshttps://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-history-forward
public void Forward()Go(int)
History.cshttps://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-history-go