Try Install Learn Blog API Packages GitHub
Pages
core

Search
Entities

Url

Functions

createObjectUrlFromFile
(
file
:
File
)
:
String

Creates an url from the given file, which is available until the current window is closed.

File.fromString("Content", "test.html", "text/html")
|> Url.createObjectUrlFromFile()
createObjectUrlFromString
(
string
:
String
type
:
String
)
:
String

Creates an url from the given content and type, which is available until the current window is closed.

Url.createObjectUrlFromString("Content", "text/html")
parse
(
url
:
String
)
:
Url

Parses the given string as an Url.

Url.parse("https://www.example.com").host == "www.example.com"
revokeObjectUrl
(
url
:
String
)
:
Void

Releases an existing object URL which was previously created.

Url.createObjectUrlFromString("Content", "text/html")
|> Url.revokeObjectUrl()
toString
(
url
:
Url
)
:
String

Converts the given Url to a String.

(Url.parse("https://www.example.com/path/?search=foo#hash")
|> Url.toString()) == "https://www.example.com/path/?search=foo#hash"