Sample use cases for the Storage Access API

To better understand how SAA functions in different contexts, let's explore two scenarios:

Use case Scenario Requirements
Using Storage Access on its own

A user visits Weather.example to check their local weather.

Later, they visit News.example, which has a Weather.example widget embedded on its page.

When the user interacts with the weather widget, it requests access to its cookies through SAA.

The browser displays a prompt asking the user for permission to grant access.

Once permission is granted, Weather.example can access its cookies and display relevant weather information.

  • The user must have previously visited the embedded widget's top-level site (for example, Weather.example).
  • The user must interact with the widget (for example, click or attempt to type).
  • The browser will display a permission prompt.

Using Storage Access with Related Website Sets

A user visits News.example, which belongs to the same Related Website Set as Weather.example.

Weather.example is embedded on News.example to display local weather.

When the user interacts with the Weather.example widget or the News.example page, Storage Access is used to request access to cookies.

Either website can request access for the embedded content.

Since both sites are in the same Related Website Set, access is granted automatically without a prompt.

  • The user must interact with the widget or the top-level page.
  • No prior visit to the widget's top-level site is required.
  • No permission prompt is displayed.

Key differences

Using Storage Access with Related Website Sets offers a more streamlined experience by:

  • Eliminating the need for users to have visited the widget's top-level site.
  • Removing the permission prompt, as access is automatically granted between related sites.

This approach provides greater flexibility and convenience while still maintaining user privacy within a defined set of related websites.

Learn more about the Storage Access API use cases in the developer documentation.

Was this helpful?

How can we improve it?
Search
Clear search
Close search
Main menu
7261406358180967415
true
Search Help Center
true
true
true
false
false
false
false