This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
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().
For more information, see blob URLs.
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.
URL.revokeObjectURL(objectURL)
objectURLA string representing an object URL that was previously created by calling createObjectURL().
None (undefined).
See Using object URLs to display images.
| Specification |
|---|
| File API> # dfn-revokeObjectURL> |
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Opera | Safari | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | WebView Android | WebView on iOS | |
revokeObjectURL_static |
19 | 12 | 19revokeObjectURL() is no longer available within the context of a ServiceWorker. |
15 | 6 | 25 | 19revokeObjectURL() is no longer available within the context of a ServiceWorker. |
14 | 6 | 1.5 | 4.4 | 6 |
URL.createObjectURL()
© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/URL/revokeObjectURL_static