window.location fits usecase better