You must implement it yourself which is quite easy.
- When invoking
pushStategive the data object a unique incrementing id (uid). - When
onpopstatehandler is invoked; check the state uid against a persistent variable containing the last state uid. - Update the persistent variable with the current state uid.
- Do different actions depending on if state uid was greater or less than last state uid.