demo · v150

Cookies Fallback Test

document.requestStorageAccessFor() is gone in Chrome 150. This page probes all three Storage Access API entry points, shows their current availability, then tests the correct replacements: document.hasStorageAccess() and document.requestStorageAccess(). The replacement APIs require an iframe context with a user gesture — this page shows what each returns when called from a top-level context.

Removed in Chrome 150
document.requestStorageAccessFor checking…
// REMOVED in Chrome 150
// Was: top-level page requests on behalf of embedded origin
await document.requestStorageAccessFor(
  'https://embedded.example.com'
);
// → undefined in Chrome 150 (method gone)
Still present (replacements)
document.hasStorageAccess checking…
document.requestStorageAccess checking…
document.cookie (top-level) checking…
navigator.cookieEnabled checking…

Live results log

Replacement patterns

Old — top-level requestStorageAccessFor (removed):

// Called from the TOP-LEVEL page on behalf of embed
// → REMOVED in Chrome 150

document.requestStorageAccessFor('https://embed.example')
  .then(() => console.log('Access granted'))
  .catch(e => console.error('Blocked:', e));

New — requestStorageAccess from inside the iframe:

// Called from INSIDE the embedded iframe
// after a user gesture (click, key press)

// In the embedded frame:
btn.addEventListener('click', async () => {
  try {
    await document.requestStorageAccess();
    // Now unpartitioned cookies are accessible
    const hasAccess = await document.hasStorageAccess();
    console.log('Access:', hasAccess);
  } catch (e) {
    console.error('Denied:', e);
  }
});

hasStorageAccess result (from this top-level context)

Note: from a top-level context, hasStorageAccess() typically returns true (you already have first-party storage access). requestStorageAccess() from a top-level context is a no-op or throws — it's designed for use inside embedded cross-origin iframes.

// Chrome 150: the correct pattern for cross-site cookie access
// is to call requestStorageAccess() from inside the embedded iframe,
// triggered by a user gesture.

// 1. Embed the cross-origin frame
// <iframe src="https://embed.example.com/login" allow="storage-access">

// 2. Inside https://embed.example.com/login:
document.querySelector('#grant-btn').addEventListener('click', async () => {
  if (await document.hasStorageAccess()) {
    console.log('Already have storage access');
    return;
  }
  await document.requestStorageAccess();
  // Now cookies set with SameSite=None; Secure are readable
});

see also

implementation reference

Need the exact API surface, compatibility boundaries, errors, lifecycle, and source links? Read the matching gendn reference ↗