How to persist login using containers
Hi, new here!
I'm using Firefox's Multi-Account Container extension (https://addons.mozilla.org/en-US/firefox/addon/multi-account-containers/). I have a container called Twitter Personal to sign into my personal Twitter account. I want this login within the container persisted when Firefox is closed. However, any other cookies/logins I want deleted.
Note:
- To setup arkenfox, I followed this guide: https://12bytes.org/articles/tech/firefox/the-firefox-privacy-guide-for-dummies/.
- My
user-overrides.jsfile is copied from here: https://codeberg.org/12bytes.org/firefox-user.js-supplement/src/branch/master/user-overrides.js
Any suggestions to set in the user-overrides.js file to allow this to happen?
#1543
Thanks for response!
I just tried this and it does not work:
user_pref("permissions.isolateBy.userContext", true);
I tried adding this to my preexisting user-overrides.js file but did not work.
Then to start from clean slate, my entire user-overrides.js file now just contains and still doesn't work:
user_pref("permissions.isolateBy.userContext", true);
Die you just add it to user-overrides.js or did you anything more (updater, restart, ...)?
Did you added the exception with ctrl-i?
Here are the steps I took:
- Quit Firefox
- Deleted everything in
user-overrides.js - Added
user_pref("permissions.isolateBy.userContext", true);. I did this by copying/pasting from https://codeberg.org/rusty-snake/firefox-config/src/commit/ea079491d22113843d61b3d93455518cdd00abad/assets/user-overrides.js#L25-L26. I am using Visual Studio Code which is plain text so no italicize. - I ran
./updater.sh - I ran
./prefsCleaner.sh - Opened Firefox -> opened a custom container -> signed into Twitter -> Quit Firefox -> Opened Firefox -> Opened custom container and Twitter is logged out
Note:
- not sure what you mean by
ctrl-i - I am using the GUI to setup containers with https://addons.mozilla.org/en-US/firefox/addon/multi-account-containers/
You need to add an cookie exception.
https://github.com/arkenfox/user.js/blob/3f09afdee07c5aea33f6dc4194e1425d6400a0d7/user.js#L768-L778
edit: https://github.com/arkenfox/user.js/wiki/3.2-Overrides-%5BCommon%5D#-keep-logins
Ah I think it works now! So just to outline what I did:
- For clean slate, deleted everything and just added
user_pref("permissions.isolateBy.userContext", true)touser-overrides.js - Run
./updater.shand then./prefsCleaner.sh - Go to
☰ Settings > Privacy & Security > Cookies & Site Data > Manage Exceptions - Enter
https://www.google.com(or Twitter, etc) - Create a container using https://addons.mozilla.org/en-US/firefox/addon/multi-account-containers/
- Signin to Google within custom container
- Quit Firefox -> Reopen Firefox -> Go to container and should be logged into Google
I have one other question for this:
- Since I allowed
https://www.google.comcookies, will these be deleted in every tab after quitting Firefox? I would like them to be deleted except for the custom container. Please let me know if need other setting inuser-overrides.jsto do this if necessary? Seems like cookies persist
@rusty-snake I don't use containers
two questions
- without the pref, are exceptions not kept?
- i.e containers are not treated as a different origin
- e.g. if I always open
abc.comin a set container and exempt it, then it just works? yes?
- with the pref, do you need to add a contextId
- e.g. if you have two containers for two gmail accounts
Perhaps we should add permissions.isolateBy.userContext to the user.js (and mod the wiki) with some info
Sorry I don't get your question.
What I found out yet by testing in my Nightly
- containers always isolate cookies, exceptions do not stop this (tested by changeing theme on DDG)
- Permissions are bound to a container and get a
^userContextId=- e.g. block camera in one container (via ctrl-i), same site in other container will show camera prompt.
- New to me: cookie/storageAccessAPI permissions are special (since when?) and shared between all containers (sAA have an
^userContextId=but is implicitly propagated into/out-of containers)
Sorry I don't get your question.
you're the one telling users to add a pref - the least you could do is explain it
Sorry I don't get your question.
What I found out yet by testing in my Nightly
containers always isolate cookies, exceptions do not stop this (tested by changeing theme on DDG)
Permissions are bound to a container and get a
^userContextId=
- e.g. block camera in one container (via ctrl-i), same site in other container will show camera prompt.
New to me: cookie/storageAccessAPI permissions are special (since when?) and shared between all containers (sAA have an
^userContextId=but is implicitly propagated into/out-of containers)
Same behaviour here on stable. Camera and microphone (and I assume other permissions too) get a UserContextId when setting the permission when the pref is flipped. Cookie perms don't get a ContextId tho, could be a bug as I'm pretty sure it's supposed to behave like other perms as well.
closing after 25 days - if there is a need or want to add permissions.isolateBy.userContext and document it, or there is a need to know how to persist logins per container (doesn't it just work?) then feel free to re-open and explain it