PageTransitionEvent.persisted
The persisted
read-only property indicates if a webpage is loading from a cache.
Syntax
window.addEventListener('pageshow', function(event) { if (event.persisted) { console.log('Page was loaded from cache.'); } });
Value
A boolean value.
Specifications
Browser compatibility
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
persisted |
4 |
12 |
11 |
11
The
persisted property is known to be buggy in Internet Explorer. It is advised to check if window.performance.navigation.type == 2 as well. |
15 |
5 |
≤37 |
18 |
14 |
14 |
4 |
1.0 |
© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/PageTransitionEvent/persisted