vishal
New Coder
I want to perform an action when user navigates from one page to another but i don't want to perform anything when user clicks on back arrow or basically goes to previous screen using browsers history.
Navigation is being done normally like using anchor tags or window.location.href.
I have tried storing referrer value in session storage but it fails when we navigate to the same previous page through different trigger like
Page A -> Page B -> Page A (through anchor tag click not back arrow) -> Page B (through anchor tag click not back arrow)
This above scenario fails when we store referrer value in session storage to find out that whether user is going back in history or not.
Navigation is being done normally like using anchor tags or window.location.href.
I have tried storing referrer value in session storage but it fails when we navigate to the same previous page through different trigger like
Page A -> Page B -> Page A (through anchor tag click not back arrow) -> Page B (through anchor tag click not back arrow)
This above scenario fails when we store referrer value in session storage to find out that whether user is going back in history or not.