Reputation: 587
The question is pretty much in title.
Is there a way in Javascript to determine whether the page has been refreshed by user or loaded after redirecting from other website?
Upvotes: 3
Views: 4803
Reputation: 378
Just to give a straight answer, as the answer above says you should
console.log(window.performance.navigation.type)
to see if the page was reloaded or redirected. 1 = reloaded and 0 = redirected.
Upvotes: 3