W3cubDocs

/DOM

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

window.URL.revokeObjectURL(objectURL);

Parameters

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

Return value

undefined.

Example

See Using object URLs to display images.

Specification

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

Browser compatibilityUpdate compatibility data on GitHub

Desktop
Chrome Edge Firefox Internet Explorer Opera Safari
Basic support 8 12 4
4
revokeObjectURL() is no longer available within the context of a ServiceWorker.
10 15 6
Mobile
Android webview Chrome for Android Edge Mobile Firefox for Android Opera for Android iOS Safari Samsung Internet
Basic support ? 18 ? 4
4
revokeObjectURL() is no longer available within the context of a ServiceWorker.
15 6 ?

See also

© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/URL/revokeObjectURL