Is it possible to detect that a user entered a page through using the history back button in his browser? Preferably I want to detect this action using polymer.
Asked
Active
Viewed 1,686 times
6
-
No,it's not possible (easily). – Dec 23 '16 at 06:22
-
possible duplicate of http://stackoverflow.com/questions/1844491/intercepting-call-to-the-back-button-in-my-ajax-application-i-dont-want-it-to – webmonkey Dec 23 '16 at 06:38
-
Do you use Polymer's router? – Ali Naci Erdem Dec 23 '16 at 07:34
-
yes.. i use
– aries12 Dec 23 '16 at 07:37 -
Have you tried the [history API](https://developer.mozilla.org/en-US/docs/Web/Events/popstate)? – Ali Naci Erdem Jul 28 '17 at 19:19
1 Answers
1
You could probably listen on the popstate
event as documented here:
https://developer.mozilla.org/en-US/docs/Web/Events/popstate
This should fire when the back button is clicked, history.back()
is called, etc.

JJJ
- 340
- 1
- 8