-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ephemeral Storage on 1p is not working correctly with LocalStorage #33077
Comments
I'm not sure if this actually worked as you described previously, because I also see issues with "localStorage" access error on older versions based on Chromium 116 and 115. But things might've changed after #30090, it prolonged ES cleanup event to hold 30 seconds after a page close. This means a quick tab close/open did work previously, but now it doesn't work like that. I'm going to merge a change that should switch storages on page reload properly. |
You are right, it has never worked the way I described it, my mistake. I tested older versions, even went and installed 1.33.1 which is one of the first builds with it and it behaves exactly the same, I even see the same error with LocalStorage.
So, it is good this was finally noticed and now it is getting fixed, so it works fine like it does with cookies. Thanks for your work! |
Sites that clear cookies when you close them
(Ephemeral Storage on 1p) is not working correctly in Chromium 117
@goodov could you please add the needed labels for this one?
Also, if |
This is a small QoL change that's not noticeable in most scenarios. I've added a test that ensures new functionality works as expected, no other tests were broken/modified. No need to QA this. |
Description
This issue doesn't seem to affect cookies, but Ephemeral Storage has to be completely tested to see what's wrong with it, this issue seems mostly about other storages like Local and Session Storage, but I am not sure about other storages.
@goodov
To use Ephemeral Storage on 1p, sites have to be added to
Sites that clear cookies when you close them
, the problem is that when you add the site to it, and refresh, the site is not using the Ephemeral Storage right away for LocalStorage like it does for Cookies.Same with switching from
Clear on site close
toAllow
, the website should switch to Persistent Storage right away, but both scenarios are currently not working correctly, without either closing the site or restarting browser.But for example:
If you add a site to
clear on site close
before open it, you will get the site working in the Ephemeral Storage, but switching to Persistent Storage is not going to happen, the site will keep using Ephemeral Storage, any change and everything will go to Ephemeral Storage. It will only work, if you close the site, and re-open it, which will clear the Ephemeral Storage and somehow will make it work, because again: refreshing doesn't switch storages anymore.If you try to use Ephemeral Storage after visiting a site, it won't work, the browser seems to need a restart for the site to start using the Ephemeral Storage, if not, writing any Storage item will fail, like if it was set to
Block
, so you might see the site going back to 'defaults', but you can't make any change.This is a video of what I mean, I am using https://mdn.github.io/dom-examples/web-storage/ to easily display and explain the issue, I know there is https://dev-pages.bravesoftware.com/storage/ephemeral-storage.html but needed something more visual to explain this issue better. When LocalStorage/SessionStorage, breaks, I could set cookies and IndexDB seemed not to throw any error when adding it through the console. But I still think Ephemeral Has to be tested and see if something else is failing besires the Local/Session Storages.
Brave-EpehemralStorage1p.mp4
This is what I do in the video, just in case is not clear what I am trying to show:
So basically, the feature of Brave of being able to switch Storages for LocalStorage is not working correctly in Brave and sometimes completely breaks. Cookies seem to work fine, so it seems to be just a LocalStorage problem.
Switching Ephemeral Storage to Persistent Storage, is one of the best features of Brave, because you can have a basic/mini version of Firefox Containers inside Brave, where you can easily have two accounts logged and switch between them when used correctly.
I made this videos to show how the 'switching' works differently InPrivate mode, but not in Normal windows.
I used Twitch and the BTTV extension which uses LocalStorage to set settings, to easily display how only Normal Windows have the problem of not completely switching to Ephemeral Storage for the data.
Like it works with Cookies but not Local Storage items.
Private window
Brave-00000000.mp4
Normal window
Brave-00000464.mp4
Steps to Reproduce
Add
https://[*.]mdn.github.io:443
toSites that clear cookies when you close them
inbrave://settings/cookies
go to https://mdn.github.io/dom-examples/web-storage/ and change settings
go back to
brave://settings/cookies
and move the site toSites that can always use cookies
orAllow
Refresh site. it will not reset to 'default red' and will keep using Ephemeral Storage
Site has to be closed and re-opened for Persistent Storage to work
go back to
brave://settings/cookies
move site toSites that clear cookies when you close them
orClear on site close
and refresh site.it will go back to 'default red' but you can't change any setting and Devtools will display an error
Uncaught DOMException: Failed to read the 'localStorage' property from 'Window': Access is denied for this document.
Now Restart Browser and open website again, it will start using Ephemeral on 1p again.
Brave version (brave://version info)
1.60.28 Chromium: 117.0.5938.62 (Official Build) nightly (64-bit) Windows 11 22h2
The text was updated successfully, but these errors were encountered: