Just to ensure, I am NOT asking how to catch back/forward button events.
window.addEventListener('popstate', function (e) {
alert("Yahoooo!!!!");
});
That function above is triggered either it is browser's back button or browser's forward button but I cannot detect which one was clicked? Was it back button or forward button?
Is there any specific event for them that I can detect it was "back" or "forward" button specifically?
EDIT: While I appreciate the "duplicate question" suggestion, the similar question posted here on stackoverflow but the accepted answer is from January 2012!! A lot of things changed since then. Maybe there is already easier way for this!
Thanks