Firefox Tomorrow

web api static method

URL: createObjectURL() static method

View on MDN ↗

Available in workers

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

For more information, see blob URLs.

To release an object URL, call revokeObjectURL().

[!NOTE] This feature is not available in Service Workers due to its potential to create memory leaks.

Syntax

URL.createObjectURL(object)

Parameters

Return value

A string containing an object URL that can be used to reference the contents of the specified source object.

Examples

See Using object URLs to display images.

Specifications

SpecificationsStandards references are available on the canonical MDN page.

Browser compatibility

Browser compatibilityCompatibility data is available on the canonical MDN page.

See also