Resolves a URL, returning a normalized absolute URL string.
Document-relative inputs are resolved against document.baseURI (the <base href>, defaulting to
the document location) to match how the browser resolves relative request URLs — so the URL
recorded for a fetch/XHR matches the one actually requested. Falls back to location.href in
environments without a document (workers, SSR). Absolute and root-relative inputs ignore the base
and are unaffected.
Resolves a URL, returning a normalized absolute URL string.
Document-relative inputs are resolved against
document.baseURI(the<base href>, defaulting to the document location) to match how the browser resolves relative request URLs — so the URL recorded for a fetch/XHR matches the one actually requested. Falls back tolocation.hrefin environments without a document (workers, SSR). Absolute and root-relative inputs ignore the base and are unaffected.