requestStorageAccessFor()
- Related Website Sets demorequestStorageAccess()
in a cross-site, same-set iframe
.requestStorageAccessFor()
for embedded cross-site, same-set resources.๐งโ๐ป Code for this page.
This demo uses two sites: related-website-sets.glitch.me
and rws-member-1.glitch.me
, which are both part of the same Related Website Set. related-website-sets.glitch.me
sets a cookie named crossSite
to that will be allowed in the cross-site, same-set contexts via the Storage Access API.
๐ช crossSite
cookie sent on cross-site, same-set requests?
navigator.permissions.query({name: 'top-level-storage-access', requestedOrigin: 'https://related-website-sets.glitch.me'}).then(res => {โฆ}
and see that res.state
is [โฆ]
.prompt
we need to put the document.requestStorageAccessFor('https://related-website-sets.glitch.me').then(res => {โฆ})
behind a user gesture, e.g. clicking a button:granted
we can just call document.requestStorageAccessFor('https://related-website-sets.glitch.me').then(res => {โฆ})
immediately โ [โฆ]requestStorageAccessFor()
call, cross-site requests will include cookies if they include CORS or the crossorigin
attribute.๐ช crossSite
cookie sent on subsequent cross-site, same-set requests?