code: function resolveURL (args) {
      var from = args.from;
      var to = args.to;
  
      if (typeof URL === 'function') {
        // This browser supports the WHATWG URL API
        return new URL(to, from || location.href).href;
      }
      else if (protocolPattern.test(to)) {
        // It's an absolute URL, so return it as-is
        return to;
      }
      else if (to.substr(0, 2) === '//') {
        return resolveProtocolRelativeURL(from, to);
      }
      else if (to[0] === '/') {
        return resolveOriginRelativeURL(from, to);
      }
      else {
        return resolvePathRelativeURL(from, to);
      }
    }
docs: Resolves a URL, relative to a base URL.
  
  @param {?string} args.from
  The base URL to resolve against. If unset, then the current page URL is used.
  
  @param {string} args.to
  The URL to resolve. This may be absolute or relative. If relative, then it will be resolved
  against {@link args.from}
  
  @param {function} args.next
  Calls the next plugin, if the URL is not an HTTP or HTTPS URL.
  
  @returns {string|undefined}