Description
Apple WebKit is interested in exploring if we can allow browser engines to reload a cross-site frame after it is granted storage access through the Storage Access API. That would allow web engines on resource-constrained platforms to only use site isolation for sub frames with access to unpartitioned storage.
There is a difference in data leakage risk between cross-site frames with partitioned storage and cross-site frames with unpartitioned storage. It's most important to isolate documents with personal content, and personal content almost always implies unpartitioned storage. Put differently, being logged in almost always implies access to first-party cookies.
The switch to an isolated process could be done either by a mandatory frame reload on granted storage access (crude) or in a way that's controlled by JavaScript in the frame (perhaps more elegant). For the latter, imagine this for cross-site frame X:
- X calls
document.hasStorageAccess()
and learns that it does not currently have access. - X indicates with a button that the user needs to interact with the content to activate it.
- The user taps the button in X.
- X calls
document.requestStorageAccess()
. - The user has been prompted previously and opted in, so the browser automatically grants storage access.
- X gets the result back that it was granted storage access, but cookie access is not yet open.
- X calls
document.reloadOnStorageAccess()
. - The browser checks if X was granted storage access, and since it was, reloads it.
Two key things here:
- In step 8, the engine can switch process for X and ensure site isolation before personal content is loaded.
- Between step 6 and 7, we could consider allowing X to tell its server about the reload, for instance by supplying a same-site reload URL in the call to
document.reloadOnStorageAccess()
. This would forward information from X's partitioned state to its unpartitioned state which obviously has privacy implications. But it would allow for the frame reload to be part of a natural content flow.