Hierarchical identifiers: Returns the root-relative path (starting with /) if scheme and authority match
Opaque identifiers: Returns the scheme-specific part if schemes match
Parameters
base: string
The absolute base identifier providing the scheme and authority context
reference: string
The reference to internalize
Returns string
A root-relative reference if same origin, or the normalized absolute reference otherwise
Throws
RangeError If base is not a valid absolute identifier or reference is not a valid relative reference,
for instance because it carries an isolated UTF-16 surrogate
Throws
RangeError If the resolved path contains tree-climbing segments that would go above the root
Extracts a root-relative reference.
/) if scheme and authority match