Firefox Tomorrow

web api instance method

NotRestoredReasons: toJSON() method

View on MDN ↗

Limited availability

The toJSON() method of the NotRestoredReasons interface is a serializer; it returns a JSON representation of the NotRestoredReasons object.

Syntax

toJSON()

Parameters

None.

Return value

A JSON object that is the serialization of the NotRestoredReasons object.

Examples

The following function will return a JSON representation of the NotRestoredReasons object of the first PerformanceNavigationTiming object currently present in the performance timeline:

function returnNRR() {
  const navEntries = performance.getEntriesByType("navigation");
  let navEntry = navEntries[0];
  return navEntry.notRestoredReasons.toJSON();
}

Specifications

SpecificationsStandards references are available on the canonical MDN page.

Browser compatibility

Browser compatibilityCompatibility data is available on the canonical MDN page.

See also