URL.revokeObjectURL()

The URL.revokeObjectURL() static method releases an existing object URL which was previously created by calling URL.createObjectURL(). Call this method when you've finished using an object URL to let the browser know not to keep the reference to the file any longer.

Note:

This feature is available in Web Workers.

Note: This method is not available from service workers, due to issues with the Blob interface's life cycle and the potential for leaks.

Syntax

URL.revokeObjectURL(objectURL)

Parameters

objectURL
A DOMString representing a object URL that was previously created by calling createObjectURL().

Examples

Specifications

Specification Status Comment
File API
The definition of 'revokeObjectURL()' in that specification.
Working Draft Initial definition

Browser compatibility

BCD tables only load in the browser

See also