URL: revokeObjectURL() static method

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since January 2020.

Note: This feature is available in Web Workers, except for Service Workers.

The revokeObjectURL() static method of the URL interface 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 method is not available in Service Workers, due to issues with the Blob interface's life cycle and the potential for leaks.

Syntax

js
URL.revokeObjectURL(objectURL)

Parameters

objectURL

A string representing an object URL that was previously created by calling createObjectURL().

Return value

None (undefined).

Examples

Specifications

Specification
File API
# dfn-revokeObjectURL

Browser compatibility

Report problems with this compatibility data on GitHub
desktopmobileserver
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
Deno
Node.js
revokeObjectURL() static method

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
See implementation notes.

See also