---
title: "Improving the Storage Access API in Firefox"
description: "Ahead of enabling State Partitioning for all users, Firefox is changing its Storage Access API implementation in four ways."
url: "https://swe.quest/articles/improving-the-storage-access-api-in-firefox-aed5f1c78b716040"
canonical: "https://hacks.mozilla.org/2022/02/improving-the-storage-access-api-in-firefox/"
source: "Mozilla Hacks"
published: "2022-02-08"
difficulty: "medium"
kind: "Deep dive"
reading_minutes: 6
tags: ["browsers","privacy","identity-auth"]
---

# Improving the Storage Access API in Firefox

A post on [Mozilla Hacks](https://swe.quest/sources/mozilla-hacks.md), published 2022-02-08, 6 min read, Deep dive. Original: [https://hacks.mozilla.org/2022/02/improving-the-storage-access-api-in-firefox/](https://hacks.mozilla.org/2022/02/improving-the-storage-access-api-in-firefox/)

## Summary

Ahead of enabling State Partitioning for all users, Firefox is changing its Storage Access API implementation in four ways. Automatic storage grants now require recent user interaction with the third party, and accepted prompts or iframe interactions count as interaction. Permissions are scoped to the Site rather than the origin, which fixes login flows that move across subdomains. Interaction rules are tightened: denying a prompt clears the interaction, accepting resets its timer, and a reload requires new interaction. When third-party cookies are blocked, requestStorageAccess always rejects and hasStorageAccess returns false starting in Firefox 98.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Browsers](https://swe.quest/tags/browsers.md) (Web & mobile)
- [Privacy](https://swe.quest/tags/privacy.md) (Security)
- [Identity & auth](https://swe.quest/tags/identity-auth.md) (Security)

## Prerequisites

- browser cookies and third-party storage
- iframes
- JavaScript promises ([easy posts on JavaScript](https://swe.quest/tags/javascript.md?difficulty=easy))

## Keywords

Storage Access API, State Partitioning, Firefox, Enhanced Tracking Protection, requestStorageAccess, hasStorageAccess

## Related posts

- [The File System API with Origin Private File System](https://swe.quest/articles/the-file-system-api-with-origin-private-file-system-d365ac14632ecee7.md): WebKit · 2022-02-14 · Medium · 6 min read · Browsers, JavaScript, Frontend
  WebKit now supports the File System Standard's origin private file system, a per-origin sandboxed storage area where web apps can create, read, write, move, enumerate and delete files and directories.
- [Private Browsing 2.0](https://swe.quest/articles/private-browsing-2-0-e10509f44e8abcba.md): WebKit · 2024-07-16 · Medium · 19 min read · Privacy, Browsers, Security
  Safari 17.0–17.5 extends Private Browsing well beyond ephemeral storage, adding link tracking protection that strips known click-level tracking query parameters before navigation and hides URL query strings, fragments and cross-site referrers from third-party scripts.
- [Building Profiles with new WebKit API](https://swe.quest/articles/building-profiles-with-new-webkit-api-a47cf901a69ec207.md): WebKit · 2023-08-30 · Medium · 3 min read · Browsers, Mobile, Swift, Privacy
  macOS 14 and iOS 17 add WebKit APIs for creating multiple persistent WKWebsiteDataStore instances, each keyed by a UUID, so apps can build browser-style profiles with separate cookies and website data.
- [In March, we see Firefox 87](https://swe.quest/articles/in-march-we-see-firefox-87-89133003c9c65b13.md): Mozilla Hacks · 2021-03-23 · Medium · 4 min read · Browsers, Privacy, Developer tools, Accessibility
  Firefox 87 enables the beforeinput event and InputEvent.getTargetRanges() by default, letting web apps inspect and cancel text edits in inputs and contenteditable elements before the DOM changes, with an example that protects metadata spans inside an editable comment.
- [Hopping on Firefox 91](https://swe.quest/articles/hopping-on-firefox-91-43b40b5229f7a9ce.md): Mozilla Hacks · 2021-08-10 · Medium · 3 min read · Browsers, JavaScript, Frontend
  Firefox 91 enables the Visual Viewport API by default, making it available in all major browsers and letting pages read the visible viewport's size, offset and scale and react to resize and scroll events, such as when zooming or an on-screen keyboard appears.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
