Skip to main content

URL-1

URL: {
(url, base?): URL;
prototype: URL;
canParse: boolean;
createObjectURL: string;
parse: URL | null;
revokeObjectURL: void;
};

Type Declaration

Parameters

ParameterType
urlstring | URL
base?string | URL

Returns

URL

prototype

prototype: URL;

canParse()

canParse(url, base?): boolean;

The URL.canParse() static method of the URL interface returns a boolean indicating whether or not an absolute URL, or a relative URL combined with a base URL, are parsable and valid.

MDN Reference

Parameters

ParameterType
urlstring | URL
base?string | URL

Returns

boolean

createObjectURL()

createObjectURL(obj): string;

The createObjectURL() static method of the URL interface creates a string containing a blob URL pointing to the object given in the parameter.

MDN Reference

Parameters

ParameterType
objBlob | MediaSource

Returns

string

parse()

parse(url, base?): URL | null;

The URL.parse() static method of the URL interface returns a newly created URL object representing the URL defined by the parameters.

MDN Reference

Parameters

ParameterType
urlstring | URL
base?string | URL

Returns

URL | null

revokeObjectURL()

revokeObjectURL(url): void;

The revokeObjectURL() static method of the URL interface releases an existing object URL which was previously created by calling URL.createObjectURL().

MDN Reference

Parameters

ParameterType
urlstring

Returns

void