Web APIs
URL.createObjectURL()
Creates a temporary URL associated with a Blob in the supporting host.
Formal Syntax & Structure
javascript syntaxjavascript
URL.createObjectURL(blob)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| blob | Blob | Local binary object. |
Return Value
string
Creates a temporary URL associated with a Blob in the supporting host.
Working Example
Example Snippetjavascript
(async () => {const url=URL.createObjectURL(new Blob(["x"]));try{console.log(url.startsWith("blob:"));}finally{URL.revokeObjectURL(url);}})()