[Webkit-unassigned] [Bug 241803] Safari throws exception when calling requestStorageAccess

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jun 27 16:44:07 PDT 2022


https://bugs.webkit.org/show_bug.cgi?id=241803

--- Comment #12 from John Wilander <wilander at apple.com> ---
We have still not established that you need to use the Storage Access API at all since the domains you provided are same-site.

(In reply to Jason Wilson from comment #11)
> Here's an image of the actual code called by the page hosted in the iframe. 
> Line 20 is where the exception occurs: https://imgur.com/a/NC39tnR

You should not call hasStorageAccess() upon a user gesture.
You can only successfully call requestStorageAccess() upon a user gesture.

>From the guide I linked to above:

Make your cross-site iframe call document.hasStorageAccess() as soon as it’s rendered to check your status. Note: Don’t call this function upon a user gesture since it’s asynchronous and will consume the gesture. Once the user gesture is consumed, making a subsequent call to document.requestStorageAccess() will fail because it’s not called when processing a user gesture.

If document.hasStorageAccess() returns false, your iframe doesn’t have storage access. Now set an event handler on elements that represent UI which requires storage access and make the event handler call document.requestStorageAccess() on a tap or click. This is the API that requires a user gesture.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20220627/c49373c1/attachment.htm>


More information about the webkit-unassigned mailing list