How to check browser is reloaded?
MOHSIN ALI SOOMRO
Posted on October 26, 2021
This is experimental feature
Check if the type===navigate
then you just visit the website if type===reload
then you reload the page
//check browser reloaded then
function checkBrowserRelaoad() {
// Use getEntriesByType() to just get the "navigation" events
const perfEntries = window.performance.getEntriesByType("navigation");
for (let i=0; i < perfEntries.length; i++) {
const p = perfEntries[i];;
console.log(p?.type)
}
}
💖 💪 🙅 🚩
MOHSIN ALI SOOMRO
Posted on October 26, 2021
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
javascript How I Created Vanilla Calendar Pro — A Lightweight and Flexible JavaScript Calendar with TypeScript
November 28, 2024