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.
How to detect browser back button click event using polymer?
Asked Answered
No,it's not possible (easily). –
Led
possible duplicate of #1844991 –
Celestinacelestine
Do you use Polymer's router? –
Counterweight
yes.. i use <app-route> –
Wriggle
Have you tried the history API? –
Counterweight
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.
© 2022 - 2024 — McMap. All rights reserved.