const navEntries = performance.getEntriesByType("navigation");
const navEntry = navEntries[0];
const reason = navEntry.notRestoredReasons.reasons[0];
const json = reason.toJSON();
console.log(json); // A plain object
console.log(typeof json); // "object"
console.log(json.reason); // Same value as reason.reasonNotRestoredReasonDetails: toJSON() method / notebook
NotRestoredReasonDetails: toJSON() method
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
console.log(JSON.stringify(reason));