0

I'm trying to track browser navigation arrow's status, Like is it enabled or disabled

enter image description here

Basically i want to know whether back navigation is possible or not from the current page, so i tried with history.length but since it considers forward history as well its not working as expected,

So, I'm trying this new approach in react js by tracking the browser's back arrow status whether its enabled enter image description here or disable enter image description here but no luck so far,

There some solution on web which i tried but didn't get the expected output like , (document.referrer == "") and (history.previous) and length as i mentioned above, so that's the reason i'm trying this approach.

can anyone help me out with this is one, like is there anyway using which i can track whether the back arrow is enable (back navigation is possible) or its disabled (back navigation not possible) in browser

  • This could help you https://stackoverflow.com/a/3588420/15622190 – Kekstington Mar 02 '23 at 07:45
  • Thanks but most of the solutions given there i already tried and doesn't seems to work – Code Machine Mar 02 '23 at 07:56
  • Well, as that other answer states: you pretty much *can't.* It's not something your website should concern itself with. It should be stateless. What are you trying to do with that information to begin with? – deceze Mar 02 '23 at 08:10
  • there is back navigation button on the website so based on back history i need to hide and show that button – Code Machine Mar 05 '23 at 08:09

0 Answers0