这是 实验性技术
检查 浏览器兼容性表格 要小心谨慎在生产中使用这之前。

过时
This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.

getCost() 特性为 BudgetService interface returns a Promise that resolves to a double indicating the worst-case background operation cost of the provided background operation.

句法

var aPromise = BudgetService.getCost(operation);
aPromise.then(function(someDouble){ ... });
					

参数

operation
Must be "silent-push" .

返回

A Promise that resolves to a number.

浏览器兼容性

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
getCost 弃用 非标 Chrome 55 Edge ≤79 Firefox ? IE ? Opera 42 Safari ? WebView Android 55 Chrome Android 55 Firefox Android ? Opera Android 42 Safari iOS ? Samsung Internet Android 6.0

图例

完整支持

完整支持

兼容性未知 ?

兼容性未知

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

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

非标。预期跨浏览器支持较差。

弃用。不要用于新网站。

弃用。不要用于新网站。

元数据

  • 最后修改:
  1. BudgetService
  2. 方法
    1. getBudget()
    2. getCost()
    3. reserve()