InMemoryVisitedLinkStore Class

A VisitedLinkStore that keeps the visited links in memory. It is thread-safe, and can be shared by several browsing contexts.

public sealed class InMemoryVisitedLinkStore : VisitedLinkStore
Inheritance
VisitedLinkStore InMemoryVisitedLinkStore

Constructors

NameDescription
InMemoryVisitedLinkStore()Initializes a new instance of the InMemoryVisitedLinkStore class, partitioned by the origin of the document of the link and by the site of its top-level document.
InMemoryVisitedLinkStore(bool)Initializes a new instance of the InMemoryVisitedLinkStore class.

InMemoryVisitedLinkStore overloads

InMemoryVisitedLinkStore()

VisitedLinkStore.cs

Initializes a new instance of the InMemoryVisitedLinkStore class, partitioned by the origin of the document of the link and by the site of its top-level document.

public InMemoryVisitedLinkStore()

InMemoryVisitedLinkStore(bool)

VisitedLinkStore.cs

Initializes a new instance of the InMemoryVisitedLinkStore class.

public InMemoryVisitedLinkStore(bool partitioned)
Parameters
partitioned bool
Whether a link is only visited in the documents that could observe its navigation: the documents of the same origin, in a top-level document of the same site (https://drafts.csswg.org/selectors-4/#visited-partitioning). When false, the URL alone is the key: a visited link is visited in every document.

Properties

NameDescription
VersionGets a value that changes when the answers of VisitedLinkStore.IsVisited may have changed (e.g. a counter incremented when a link is added or when the history is cleared): the styles of the documents are computed again.

Gets a value that changes when the answers of VisitedLinkStore.IsVisited may have changed (e.g. a counter incremented when a link is added or when the history is cleared): the styles of the documents are computed again.

public override long Version { get; }

Property value

long

Methods

NameDescription
Add(VisitedLink)Records a navigation of a browsing context that uses the store: the navigations to a document, the fragment navigations, and the URL changes of history.pushState() and history.replaceState(). A navigation is recorded for its destination (its URL, with the origin of the new document and the site of its top-level document, when the document is a top-level document or has the origin of its top-level document) and, when a document started it (a link, a form or a script), for that document (the same URL, with the origin of the document and the site of its top-level document).
Clear()Removes all the visited links.
IsVisited(VisitedLink)Returns whether a link of a document was visited.

Add(VisitedLink)

VisitedLinkStore.cs

Records a navigation of a browsing context that uses the store: the navigations to a document, the fragment navigations, and the URL changes of history.pushState() and history.replaceState(). A navigation is recorded for its destination (its URL, with the origin of the new document and the site of its top-level document, when the document is a top-level document or has the origin of its top-level document) and, when a document started it (a link, a form or a script), for that document (the same URL, with the origin of the document and the site of its top-level document).

public override void Add(VisitedLink link)

Parameters

link VisitedLink
The URL of the navigation, and the document that observes it.

Removes all the visited links.

public void Clear()

IsVisited(VisitedLink)

VisitedLinkStore.cs

Returns whether a link of a document was visited.

public override bool IsVisited(VisitedLink link)

Parameters

link VisitedLink
The URL of the link, and the document that contains the link.

Returns

bool