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.

注意: 此特征可用于 Web 工作者 .

注意: This method is not available from service workers, due to issues with the Blob interface's life cycle and the potential for leaks.

句法

URL.revokeObjectURL(objectURL)
				

参数

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

范例

Using object URLs to display images .

规范

规范 状态 注释
文件 API
The definition of 'revokeObjectURL()' in that specification.
工作草案 初始定义

浏览器兼容性

The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. 更新 GitHub 上的兼容性数据
桌面 移动
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
revokeObjectURL Chrome 19 Edge 12 Firefox 19
19
revokeObjectURL() is no longer available within the context of a ServiceWorker .
IE 10 Opera 15 Safari 6 WebView Android ≤37 Chrome Android 25 Firefox Android 19
19
revokeObjectURL() is no longer available within the context of a ServiceWorker .
Opera Android 14 Safari iOS 6 Samsung Internet Android 1.5

图例

完整支持

完整支持

实验。期望将来行为有所改变。

实验。期望将来行为有所改变。

见实现注意事项。

另请参阅

元数据

  • 最后修改: