Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to detect browser back button click event using polymer?

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.

like image 895
aries12 Avatar asked Dec 23 '16 06:12

aries12


1 Answers

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.

like image 85
JJJ Avatar answered Nov 15 '22 01:11

JJJ