I think this would make more sense to implement in terms of https://developer.mozilla.org/en-US/docs/Web/API/Window.location