Consider basic auth creds in isSameOrigin

This PR changes the behavior for determining if a URL matches the current origin. Only protocol and host (including port) are taken into consideration by the browser. The current implementation here also considers basic auth credentials in the authority section of the URL.