code: function urlIsSameOrigin(requestUrl) {
    var parsed = (isString(requestUrl)) ? urlResolve(requestUrl) : requestUrl;
    return (parsed.protocol === originUrl.protocol &&
            parsed.host === originUrl.host);
  }
docs: Parse a request URL and determine whether this is a same-origin request as the application document.
  
  @param {string|object} requestUrl The url of the request as a string that will be resolved
  or a parsed URL object.
  @returns {boolean} Whether the request is for the same origin as the application document.