MutableURL
JavaScript: URL
(Mutable)
The URL
class is universally supported across JavaScript engines and browser implementations, and behaves similarly in each case; it is used for parsing well-formed URLs and extracting their constituent parts. This interface extends the built-in URL intrinsic interface with mutable properties, where supported by spec.
Mutable properties
Nearly all properties of URL
objects are "mutable," meaning they can be assigned a new value. Under the hood, the URL controlled by an Elide URL intrinsic is immutable, and modifications are atomic. From the point of view of the JS guest code, the URL is mutable in-place, even though a new URL is created for each mutation.
The following properties are never mutable, because they are read-only by spec:
origin. This property is calculated from the current URL value.
searchParams. This property is likewise calculated from the current URL value.
See also
for information about URL objects in general, both mutable and immutable, and a full documentation of fields and methods available on each URL object.
Properties
From MDN: "The pathname property of the URL interface represents a location in a hierarchical structure. It is a string constructed from a list of path segments, each of which is prefixed by a / character. If the URL has no path segments, the value of its pathname property will be the empty string."
From MDN: "The searchParams readonly property of the URL interface returns a URLSearchParams object allowing access to the GET decoded query arguments contained in the URL."