files/en-us/web/api/workletsharedstorage/remainingbudget/index.md
{{APIRef("Shared Storage API")}}{{deprecated_header}}
The remainingBudget() method of the
{{domxref("WorkletSharedStorage")}} interface returns the remaining navigation budget for the current origin.
The navigation budget is the number of entropy bits permitted inside a {{htmlelement("fencedframe")}} due to the {{domxref("WindowSharedStorage.selectURL()")}} calls per origin every 24 hours. This is not the same as the number of navigations; rather, it is based on the number of potential navigations in each call. Each time a selectURL() navigation occurs, the corresponding origin's budget decreases by the logarithm (base 2) of the number of URL choices.
Navigation budget is a mechanism designed to limit the rate of leakage of cross-site data to the destination pages navigated to in fenced frames.
remainingBudget()
None.
A {{jsxref("Promise")}} that fulfills with a number representing the remaining navigation budget.
// remainingBudget() available inside a shared storage worklet module
async function retrieveBudget() {
const budget = await this.sharedStorage.remainingBudget();
console.log(budget);
}
{{Specifications}}
{{Compat}}