code: function urlsAreSameOrigin(url1, url2) {
    url1 = urlResolve(url1);
    url2 = urlResolve(url2);
  
    return (url1.protocol === url2.protocol &&
            url1.host === url2.host);
  }
docs: Determine if two URLs share the same origin.
  
  @param {string|Object} url1 - First URL to compare as a string or a normalized URL in the form of
  a dictionary object returned by `urlResolve()`.
  @param {string|object} url2 - Second URL to compare as a string or a normalized URL in the form
  of a dictionary object returned by `urlResolve()`.
  
  @returns {boolean} - True if both URLs have the same origin, and false otherwise.