MDN self-hosted library · e01.org

NotRestoredReasons: toJSON() method

Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.

js
const navEntries = performance.getEntriesByType("navigation");
const navEntry = navEntries[0];
const reasons = navEntry.notRestoredReasons;

const json = reasons.toJSON();
console.log(json); // A plain object
console.log(typeof json); // "object"
console.log(json.url); // Same value as reasons.url
js
console.log(JSON.stringify(reasons));