You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Local storage items set via browser.newContext() missing for an iframe in Chromium #32230
The local storage item set during browser.newContext() call, for an external origin which is embedded into an iframe, is present in Chromium.
Example in Firefox
Actual behavior
The local storage item set during browser.newContext() call, for an external origin which is embedded into an iframe, is missing in Chromium.
As a result, we have failing tests because the user ends up being not automatically logged in to the application loaded by the iframe since the access token is missing from the local storage (which is how we perform the authentication, i.e. we set specific items in the local storage, via browser.newContext(), and the FE identifies us).
If in that repo you roll back to 1.37.1 and run again, it works as expected - the local storage item is present in Chromium.
Additional context
It would be great if this can be prioritised, because it is currently BLOCKING us from updating our Playwright version and we are stuck at 1.37.1, which is 1 year old now.
The test application is basically just a iframe tag with a src pointing to a URL with another origin.
Environment
It happens in any environment (also tested in linux github actions runners), but here's my laptop's:
In your example, it looks like the iframe is on carto.com while the main frame is on web.app. iframes can only access parent localstorage if they're on the same domain. You'll need to either bring them onto the same domain, or use something like the Storage Access API to share the localStorage.
To double-check that this is what's happening, try this outside of Playwright in a normal browser. Does it work there?
But this is working on 1.37.1 where we currently are stuck at because we can't update due to this issue here. Therefore, our setup is just fine since it is currently working fine.
Also, as I've mentioned, it works in Firefox, only not in Chromium (with versions >1.37.1).
And about "trying outside of Playwright", I think the issue comes from the fact that local storage items set through browser.newContext() get ignored, because you can see that there are other local storage items there, but not the one set via browser.newContext(). So, in that sense, I am not sure how much sense it makes to try this "outside Playwright"
Activity
Skn0tt commentedon Aug 22, 2024
In your example, it looks like the iframe is on
carto.comwhile the main frame is onweb.app. iframes can only access parent localstorage if they're on the same domain. You'll need to either bring them onto the same domain, or use something like the Storage Access API to share the localStorage.To double-check that this is what's happening, try this outside of Playwright in a normal browser. Does it work there?
nbaldzhiev commentedon Aug 22, 2024
But this is working on
1.37.1where we currently are stuck at because we can't update due to this issue here. Therefore, our setup is just fine since it is currently working fine.Also, as I've mentioned, it works in Firefox, only not in Chromium (with versions >
1.37.1).And about "trying outside of Playwright", I think the issue comes from the fact that local storage items set through
browser.newContext()get ignored, because you can see that there are other local storage items there, but not the one set viabrowser.newContext(). So, in that sense, I am not sure how much sense it makes to try this "outside Playwright"Skn0tt commentedon Aug 22, 2024
Apologies, I hadn't looked at the repro close enough. I can reproduce and we'll look at fixing it.
fix(chromium): disable ThirdPartyStoragePartitioning (#32701)
fix(embed): hide the empty-state notice, read `locked` from the gate (#…