Manually setting history state

The solution posted in this topic might lead you the right direction: