// Chrome and IE have a bug with `persisted` for pageshow from bfcache always returning false // https://stackoverflow.com/questions/17432899/javascript-bfcache-pageshow-event-event-persisted-always-set-to-false export function fromBfCache(event: PageTransitionEvent): boolean { const entries = (performance?.getEntriesByType?.('navigation') || []) as PerformanceNavigationTiming[] return event.type === 'pageshow' && (event.persisted || entries[0]?.type === 'back_forward') }