Is there a way to loop over the "history" object in javascript to find a specific page in the history?