Have you simly tried: URI.base.toString()
Uri.base is auto-created on load and the toString() will return the full location content. On 13 Nov., 17:26, Lennart <[email protected]> wrote: > I'm trying to get the window.location, but using the URI class (i want > to set some data in the querystring later). My page has a base href > (https://www.domain.ext/foo/), the actual window.location > ishttps://www.domain.ext/foo/bar. > > If I try new URI().toString(), it gives me the base href, which isn't > what I need. > > I tried new URI({base: false}).toString(), which gives output like > this:https://www.domain.ext/foo/[object Object]. Same goes if base is > set to true. > > I'm looking for the full uri (https://www.domain.ext/foo/bar), which > window.location gives me. > > Is this behaviour a bug or am I not seeing something?
