简体   繁体   English

如何使用聚合物检测浏览器后退按钮点击事件?

[英]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. 我希望用聚合物检测这种作用。

You could probably listen on the popstate event as documented here: https://developer.mozilla.org/en-US/docs/Web/Events/popstate 你可以听一下这里记录的popstate事件: https//developer.mozilla.org/en-US/docs/Web/Events/popstate

This should fire when the back button is clicked, history.back() is called, etc. 当单击后退按钮,调用history.back()等时,应该触发此操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM