URL:revokeObjectURL() 静态方法
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since January 2020.
备注: 此特性在 Web Worker(不包括 Service Worker)中可用。
URL
接口的 revokeObjectURL()
静态方法用于释放之前通过调用 URL.createObjectURL()
创建的现有对象 URL。
当你完成对对象 URL 的使用后,请调用此方法,让浏览器知道无需再保持对文件的引用。
备注:
由于 Blob
接口的生命周期问题及潜在的内存泄漏风险,此方法在 Service Worker 中不可用。
语法
js
URL.revokeObjectURL(objectURL)
参数
objectURL
-
表示之前通过调用
createObjectURL()
方法创建的对象 URL 的字符串。
返回值
无(undefined
)。
示例
规范
Specification |
---|
File API # dfn-revokeObjectURL |
浏览器兼容性
Report problems with this compatibility data on GitHubdesktop | mobile | server | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
revokeObjectURL() static method |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- See implementation notes.
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.