using window.history.pushState to update the url with value corresponding to a page selected by a user, know wanted a event to be triggered when that happend, but there is no native event trigger when pushSate is called.
found the answered by "I am always right" in history.pushState does not trigger 'popstate' event where in calling window.history.back() the window.onpopstate event is triggered and he gave the example of calling two times the same window.history.pushState and then window.history.back() to force the event triggered is there a better alternative?