urlsAreOnSameOrigin = (origin, destination) =>
  origin.protocol === destination.protocol &&
  /* a.host includes both hostname and port in the expected format host:port */
  origin.host === destination.host
Let the browser handle anything that doesn't look like a
target="_self" anchor