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 method is not available from service workers, due to issues with the Blob interface's life cycle and the potential for leaks.
window.URL.revokeObjectURL(objectURL);
objectURL DOMString representing a object URL that was previously created by calling createObjectURL().undefined.
See Using object URLs to display images.
| Specification | Status | Comment |
|---|---|---|
| File API The definition of 'revokeObjectURL()' in that specification. | Working Draft | Initial definition |
| Desktop | ||||||
|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | |
| Basic support | 8 | 12 | 4
|
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
|
15 | 6 | ? |
© 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