Class: URL

rune.util.URL()

The URL class offers static methods for handling a string according to the Uniform Resource Locator (URL) format.

Constructor

new URL()

Creates a new object of the URL class.
Source:

Methods

(static) fragment(url) → {string}

Returns the fragment identifier of the URL, ie. the ID on the page that the URL is trying to target.
Parameters:
Name Type Description
url string URL to process.
Source:
Returns:
Type
string

(static) host(url) → {string}

Returns the host section of a URL.
Parameters:
Name Type Description
url string URL to process.
Source:
Returns:
Type
string

(static) path(url) → {string}

Returns the path of the URL for the location, which will be the empty string if there is no path.
Parameters:
Name Type Description
url string URL to process.
Source:
Returns:
Type
string

(static) port(url) → {number}

Returns the port number of the URL. If the URL does not contain an explicit port number, it will be set to -1.
Parameters:
Name Type Description
url string URL to process.
Source:
Returns:
Type
number

(static) protocol(url) → {string}

Returns the protocol scheme of the URL.
Parameters:
Name Type Description
url string URL to process.
Source:
Returns:
Type
string