Clicking back button calls pushstate many time
-
The issue is that when using the plugin with non english urls, when clicking browser back the url is not going back, and instead there’s a scroll and multiple pushstate urls.
I think there’s a bug in the plugin. Throughout the load_products.js the plugin uses decodeURIComponent except for one place in br_load_more_html5. The check whether to push state or not is:
next_page && location.href != next_page
but next_page is decoded, and location.href is not, so it pushes a state.
So on load it pushes the same url twice, so clicking back actually goes to same page.. I didn’t continue to check but somehow you get to many many pushstates of the same url as u click back.
A quick tested fix for the issue is to decode the location.href i.e.
next_page && decodeURIComponent(location.href) != next_page
- The topic ‘Clicking back button calls pushstate many time’ is closed to new replies.