window.location.origin logic