Skip to content
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

bugfix: Fix Temporary Containers Automatic mode | change firefox -> zen for default cookiestore id #2411

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

lbrooney
Copy link

@lbrooney lbrooney commented Oct 30, 2024

Closes #172

This PR fixes automatic mode for Temporary Containers by patching firefox-default to zen-default. I also included changes to the other store names to maintain consistency.

Based off brief testing this does not impact Workspaces. The default container of a workspace takes precedence over an automatic container generated say by Temporary Containers.

I can't comment whether this fix breaks other container extensions. If they hardcoded checking cookieStoreId against firefox-default, then this fix would break them.

Why temporary containers doesn't work

Inspecting the Temporary Containers extension and then opening a new tab, you will notice an uncaught error from showOrHide caused by L4943.

Examining Temporary Containers source code, showOrHide is found in pageaction.ts with the line causing the throw at L43. The correct behaviour is the if else on L31 executing, not the else.

In Zen that if else doesn't execute because Temporary Container assumes the default cookieStoreId is the browser's name (zen) appended with -default. However the default cookiestore id is set to firefox-default. Thus the else if doesn't execute as zen-default does not equal firefox-default and the extension proceeds to the else causing the error.

More generally if the above error did not occur, Automatic mode would still not would as the necessary steps would not trigger here(for on created automatic mode) or would return early here(for on request Automatic Mode) as it would be looking for zen-default when the value is actually firefox-default.

Breaks:

@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. Bug labels Oct 30, 2024
@lbrooney lbrooney changed the title bugfix: change firefox -> zen for store name bugfix: change firefox -> zen for default store name Oct 30, 2024
@lbrooney lbrooney changed the title bugfix: change firefox -> zen for default store name bugfix: change firefox -> zen for default cookiestore name Oct 30, 2024
@mauro-balades
Copy link
Member

Id have to investigate this, as idk if it'll log out of all session for all users updating

@lbrooney
Copy link
Author

Based off a quick test, when using the tab without a container, I don't get logged out of accounts when I change from firefox-default to zen-default and vice versa. This was done in the dev environment. Also doesn't affect the session status in other containers. Excited to hear your results!

@lbrooney lbrooney changed the title bugfix: change firefox -> zen for default cookiestore name bugfix: Fix Temporary Containers Automatic mode | change firefox -> zen for default cookiestore id Nov 5, 2024
@lbrooney
Copy link
Author

Hi,
Just wondering if there were anything blocking this from being merged? If there's something I can do to help out or speed it along I'm willing to contribute.

Thanks for all your hard work!

@lbrooney
Copy link
Author

lbrooney commented Nov 16, 2024

This PR would break Simple Tab Groups automatic temporary container functionality as it checks against firefox-default

Copy link
Contributor

@vraravam vraravam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link

@avelino avelino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
this worked to solve the problem reported here #172 (I tested locally)

@vraravam
Copy link
Contributor

vraravam commented Dec 8, 2024

can this be merged please @mr-cheff ?

@JSGRD22
Copy link
Contributor

JSGRD22 commented Jan 9, 2025

Does this break the Firefox Multi-Account Containers extension? The extension is essential for properly syncing containers together with workspaces.

@lbrooney
Copy link
Author

lbrooney commented Jan 10, 2025

I personally haven't observed any breaking behaviour, but my testing hasn't been thorough.

Looking at the code of Multi-Account Containers it doesn't look like it breaks anything. Every new "no container" tab is counted as a container tab, but that's just a fun stat counter. It may impact Container remote syncing used by MAC, but I don't use that feature and I wouldn't know what behaviour change to observe.

In regards to behaviours when interacting with the Temporary Containers extension, if a workspace has a default container set, that default container will be used upon opening a new tab instead of a temporary container(assuming Temporary Containers was in Automatic mode).

For people who want to fix Temporary Containers Automatic Mode for Zen without this patch you can do the following:

  1. Make sure to have Temporary Containters installed and that it's done its first install setup
  2. Go to about:debugging
  3. In Debugging go to This Zen
  4. Scroll until you see the Temporary Containers extension and click the Inspect button
  5. A Developer Tools menu should pop out, click on Storage and within storage click the Extension Storage Tab and that should expand to display something with the name moz-extension://, click it
  6. Some items should popup on the right, at the top should be containerPrefix, edit the item text from zen to firefox
  7. Restart Zen and automatic mode of Temporary Containers should work.

@lbrooney lbrooney force-pushed the bugfix/fix-temporary-containers-automatic branch from 75bd3ed to a74f878 Compare January 10, 2025 06:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug size:S This PR changes 10-29 lines, ignoring generated files.
Projects
Status: To Review
Development

Successfully merging this pull request may close these issues.

Temporary Containers Automatic Mode doesn't work on Zen Browser
5 participants