Web/API/URL/revokeObjectURL

From Get docs
< Web/API‎ | URL


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

See Using object URLs to display images.

Specification

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

Browser compatibility

Update compatibility data on GitHub

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet

revokeObjectURL

Experimental'

Chrome

Full support 19

Edge

Full support 12

Firefox Full support 19

Notes'

Full support 19

Notes'

Notes' revokeObjectURL() is no longer available within the context of a ServiceWorker.

IE

Full support 10

Opera

Full support 15

Safari

Full support 6

WebView Android

Full support ≤37

Chrome Android

Full support 25

Firefox Android Full support 19

Notes'

Full support 19

Notes'

Notes' revokeObjectURL() is no longer available within the context of a ServiceWorker.

Opera Android

Full support 14

Safari iOS

Full support 6

Samsung Internet Android

Full support 1.5

Legend

Full support  
Full support
Experimental. Expect behavior to change in the future.'
Experimental. Expect behavior to change in the future.
See implementation notes.'
See implementation notes.


See also