code: function(path, base)
          {
              base = base && base !== "/"  ? base + "/" : "/";
              if(
                  !hasProtocol(base, base.substr(0, 2))
              ) {
                  base = win.location.origin + base;
              }
              path = new win.URL(path, base).href.replace(win.location.origin, "");
              // if it has a trailing slash i.e. a directory, remove the trailing slash
              var len = path.length - 1;
              return path[len] === "/" ? path.substr(0, len) : path;
          }
docs: base should always be without a trailing /