How to detect browser back button click event using polymer?

1.6k views Asked by At

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.

1

There are 1 answers

0
JJJ On

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.