After pushing URLs with window.history.pushState, I can listen when users press the back button on the browser via window.onpopstate:
window.history.pushState
window.onpopstate