Moving pushstate history modification outside of polling