desktop icon indicating copy to clipboard operation
desktop copied to clipboard

Temporary Containers Automatic Mode doesn't work on Zen Browser

Open Muko-Tabi opened this issue 1 year ago • 6 comments

What happened?

Temporary Containers Extension Issue

Extension Details

  • Name: Temporary Containers
  • URL: https://addons.mozilla.org/en-US/firefox/addon/temporary-containers/

Issue Description

The Temporary Containers extension is designed to automatically assign new tabs to temporary containers when the "Automatic Mode" setting is enabled. This feature works as expected in regular Firefox up to the current Developer Edition as of now, even if the extension is outdated. However, when using the Zen browser the "Automatic Mode" feature doesn't work.

Steps to Reproduce

  1. Install the Temporary Containers extension in Firefox.
  2. Open the Temporary Containers extension settings.
  3. Go to General and tick "Automatic Mode".
  4. Open a new tab.

Expected Result

When opening a new tab in step 4, the Temporary Containers extension should automatically assign the tab to a temporary container.

Actual Result

When opening a new tab in step 4 in Zen Browser, the Temporary Containers extension does not automatically assign the tab to a temporary container.

  • Would be nice if there's a workaround or the project can integrate the extension into it, since this is currently why I'm still using normal Firefox. Thanks in advance :D

Reproducible?

  • [X] I have checked that this issue cannot be reproduced on Mozilla Firefox.

Version

Alpha build - 1.0.0-a.12

Severity impact

Medium, Enhancement

What platform are you seeing the problem on?

Linux, Windows

Relevant log output

No response

Muko-Tabi avatar Aug 06 '24 02:08 Muko-Tabi

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Sep 08 '24 09:09 github-actions[bot]

Does it still happen?

mr-cheffy avatar Sep 11 '24 13:09 mr-cheffy

yup still happen, same with Floorp and Librewolf as well

Muko-Tabi avatar Sep 11 '24 13:09 Muko-Tabi

It still occurs on Zen, but works normal for me on Librewolf

howyay avatar Sep 25 '24 03:09 howyay

yup still happen, same with Floorp and Librewolf as well

it's probably the extension's fault then, no?

mr-cheffy avatar Oct 05 '24 07:10 mr-cheffy

yup still happen, same with Floorp and Librewolf as well

it's probably the extension's fault then, no?

@mauro-balades It is working on Librewolf

https://github.com/user-attachments/assets/f8a89e74-10ef-4699-89d9-82abb6d4b324

somerandom2 avatar Oct 13 '24 11:10 somerandom2

I think I found a solution. Inspecting the Temporary Containers, you will immediately notice a lot of uncaught errors from showOrHide caused by L4943. The extension is trying to get a container with id firefox-default, but that does not exist.

Examining Temporary Containers source code, showOrHide is found in pageaction.ts with the line causing the throw at L43. For why it's throwing, in Firefox you never reach the else instead the if else on L31 is executed. In Zen that if else doesn't execute because the extension checks whether the default cookiestore id is being used by getting the browsers name which gives zen and appending -default, but the default cookiestore id is firefox-default. The else if doesn't execute as zen-default does not equal firefox-default and instead the else executes which causes the error.

Setting global.DEFAULT_STORE in /toolkit/components/extensions/parent/ext-toolkit.js to zen-default makes Automatic Mode in Temporary Containers functional.

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.

lbrooney avatar Oct 30 '24 00:10 lbrooney

Hi, @Muko-Tabi. I'm Dosu, and I'm helping the desktop team manage their backlog. I'm marking this issue as stale.

Issue Summary:

  • The "Automatic Mode" feature of the Temporary Containers extension does not work in the Zen browser, but works in Firefox.
  • The issue occurs on both Linux and Windows, and similar problems are noted with Floorp and Librewolf.
  • @lbrooney identified the cause as an error in the extension's code related to the default cookie store ID.
  • A proposed solution involves modifying the global.DEFAULT_STORE setting, but it may affect other container extensions.

Next Steps:

  • Please let us know if this issue is still relevant to the latest version of the desktop repository by commenting here.
  • If there is no further activity, this issue will be automatically closed in 7 days.

Thank you for your understanding and contribution!

dosubot[bot] avatar Dec 04 '24 16:12 dosubot[bot]

This issue is still relevant.

lbrooney avatar Dec 11 '24 21:12 lbrooney

You can manually fix Automatic Mode by following these steps:

  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 avatar Jan 10 '25 05:01 lbrooney

Thanks for the suggestion @lbrooney but just to add that it didn't work for me. In fact somehow it broke Zen itself; new tabs would just open to a blank page and I couldn't get to any of the settings pages. Even more intriguingly, I deleted the Zen profile folder and then to get some other work done went back to normal Firefox - and that didn't work either! I kept getting error messages like "Contextual identities disabled" when I tried my old shortcuts to open containers. I eventually disabled and re-enabled the Temporary Containers extension in normal firefox, and that fixed it.

I don't plan to go back to Zen just now as I don't have time to work on this and Zen without TC is not something I want to use. But just thought I'd leave this here for anyone else who finds this bug.

shankargopal avatar Feb 21 '25 12:02 shankargopal

@shankargopal Interesting. I wasn't able to recreate your issues when attempting on a freshly created profile, but I believe when I was first migrating over to Zen I had the same issue where Zen was completely broken, everything was just blank. IIRC mine was caused by copying my Firefox profile and just pasting it in the Zen profiles directory. I fixed it by:

  1. creating a new profile in Zen (via about:profiles)
  2. launch it to complete Zen first time setup, this generates profile folder contents and prefs
  3. Close Zen and close Firefox
  4. Then to move over the Firefox profile either:
    1. (I haven't actually tested this, but I think in theory it should work) copy over the contents of your Firefox profile to the Zen profile EXCEPT for prefs.js
      1. I think zen breaking has something to with some old value set by Firefox or more likely some value required by Zen that's not set by default
    2. (what I did) I wanted a relatively fresh profile so I manually copied over what I wanted carried over, based off information here

Just to reiterate, I think the important part is not copying over the old prefs.js.

If you want to keep your old extension settings:

  1. (if you didn't copy your whole profile over) copy <profile>/storage/default to the Zen profile (where extension data is kept, more specifically extension data is stored in the folders starting with moz-extension+++)
  2. in your old Firefox prefs.js find the extensions.webextensions.uuids user_pref and overwrite the samenamed user_pref in the new Zen prefs.js or more ideally append it to the user_pref avoiding duplicates.

Unfortunately, my understanding is that Firefox settings set via about:preferences and about:config are saved to prefs.js so you'll have to reconfigure. I noticed no issues copying over my user.js, but I was using a fairly standard arkenfox setup so YMMV.

Then I fixed TC by during the previous steps I said above.

I could potentially help further diagnose the problem if you send me the exact error text or a screenshot of it, it almost sounds like the container tabs setting is disabled despite the fact that TC should force it on.

lbrooney avatar Feb 25 '25 21:02 lbrooney

As said I stopped using Zen after this so don't have anything to share as yet - am worried about risking my browsers again just now :-). But I can say that I didn't copy anything from the earlier profile at all - I just downloaded the Zen AppImage on Linux and ran it, logged into Firefox Sync, after some days of using it attempted your fix. When it stopped working, I then deleted the Zen profile folder. But after that I returned to normal Firefox as said and found the problems I reported. I still am very confused about how any of this managed to affect my existing Firefox install. I should also note that subsequent to this experience, while everything is working now, all the data from my earlier Firefox containers such as their cookies etc. seems to have been deleted - when I return to them now, I have to individually log in to each site again.

On Wed, Feb 26, 2025 at 2:58 AM Liam Rooney @.***> wrote:

@shankargopal https://github.com/shankargopal Interesting. I wasn't able to recreate your issues when attempting on a freshly created profile, but I believe when I was first migrating over to Zen I had the same issue where Zen was completely broken, everything was just blank. IIRC mine was caused by copying my Firefox profile and just pasting it in the Zen profiles directory. I fixed it by:

  1. creating a new profile in Zen (via about:profiles)
  2. launch it to complete Zen first time setup, this generates profile folder contents and prefs
  3. Close Zen and close Firefox
  4. Then to move over the Firefox profile either:
    1. (I haven't actually tested this, but I think in theory it should work) copy over the contents of your Firefox profile to the Zen profile EXCEPT for prefs.js
      1. I think zen breaking has something to with some old value set by Firefox or more likely some value required by Zen that's not set by default
    2. (what I did) I wanted a relatively fresh profile so I manually copied over what I wanted carried over, based off information here https://support.mozilla.org/en-US/kb/profiles-where-firefox-stores-user-data#w_what-information-is-stored-in-my-profile

Just to reiterate, I think the important part is not copying over the old prefs.js.

If you want to keep your old extension settings:

  1. (if you didn't copy your whole profile over) copy /storage/default to the Zen profile (where extension data is kept, more specifically extension data is stored in the folders starting with moz-extension+++)
  2. in your old Firefox prefs.js find the extensions.webextensions.uuids user_pref and overwrite the samenamed user_pref in the new Zen prefs.js or more ideally append it to the user_pref avoiding duplicates.

Unfortunately, my understanding is that Firefox settings set via about:preferences and about:config are saved to prefs.js so you'll have to reconfigure. I noticed no issues copying over my user.js, but I was using a fairly standard arkenfox setup so YMMV.

Then I fixed TC by during the previous steps I said above.

I could potentially help further diagnose the problem if you send me the exact error text or a screenshot of it, it almost sounds like the container tabs setting is disabled despite the fact that TC should force it on.

— Reply to this email directly, view it on GitHub https://github.com/zen-browser/desktop/issues/172#issuecomment-2683335929, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAK4C6JHD5BN77XHZKZSQLD2RTN7TAVCNFSM6AAAAABN22WTE2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMOBTGMZTKOJSHE . You are receiving this because you were mentioned.Message ID: @.***> [image: lbrooney]lbrooney left a comment (zen-browser/desktop#172) https://github.com/zen-browser/desktop/issues/172#issuecomment-2683335929

@shankargopal https://github.com/shankargopal Interesting. I wasn't able to recreate your issues when attempting on a freshly created profile, but I believe when I was first migrating over to Zen I had the same issue where Zen was completely broken, everything was just blank. IIRC mine was caused by copying my Firefox profile and just pasting it in the Zen profiles directory. I fixed it by:

  1. creating a new profile in Zen (via about:profiles)
  2. launch it to complete Zen first time setup, this generates profile folder contents and prefs
  3. Close Zen and close Firefox
  4. Then to move over the Firefox profile either:
    1. (I haven't actually tested this, but I think in theory it should work) copy over the contents of your Firefox profile to the Zen profile EXCEPT for prefs.js
      1. I think zen breaking has something to with some old value set by Firefox or more likely some value required by Zen that's not set by default
    2. (what I did) I wanted a relatively fresh profile so I manually copied over what I wanted carried over, based off information here https://support.mozilla.org/en-US/kb/profiles-where-firefox-stores-user-data#w_what-information-is-stored-in-my-profile

Just to reiterate, I think the important part is not copying over the old prefs.js.

If you want to keep your old extension settings:

  1. (if you didn't copy your whole profile over) copy /storage/default to the Zen profile (where extension data is kept, more specifically extension data is stored in the folders starting with moz-extension+++)
  2. in your old Firefox prefs.js find the extensions.webextensions.uuids user_pref and overwrite the samenamed user_pref in the new Zen prefs.js or more ideally append it to the user_pref avoiding duplicates.

Unfortunately, my understanding is that Firefox settings set via about:preferences and about:config are saved to prefs.js so you'll have to reconfigure. I noticed no issues copying over my user.js, but I was using a fairly standard arkenfox setup so YMMV.

Then I fixed TC by during the previous steps I said above.

I could potentially help further diagnose the problem if you send me the exact error text or a screenshot of it, it almost sounds like the container tabs setting is disabled despite the fact that TC should force it on.

— Reply to this email directly, view it on GitHub https://github.com/zen-browser/desktop/issues/172#issuecomment-2683335929, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAK4C6JHD5BN77XHZKZSQLD2RTN7TAVCNFSM6AAAAABN22WTE2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMOBTGMZTKOJSHE . You are receiving this because you were mentioned.Message ID: @.***>

shankargopal avatar Feb 26 '25 07:02 shankargopal