zen-browser / desktop

🌀 Experience tranquillity while browsing the web without people tracking you!
https://zen-browser.app
Mozilla Public License 2.0
18.96k stars 456 forks source link

Temporary Containers Automatic Mode doesn't work on Zen Browser #172

Open Muko-Tabi opened 3 months ago

Muko-Tabi commented 3 months ago

What happened?

Temporary Containers Extension Issue

Extension Details

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.

Reproducible?

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

github-actions[bot] commented 2 months ago

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

mr-cheff commented 2 months ago

Does it still happen?

Muko-Tabi commented 2 months ago

yup still happen, same with Floorp and Librewolf as well

howyay commented 1 month ago

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

mr-cheff commented 1 month ago

yup still happen, same with Floorp and Librewolf as well

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

somerandom2 commented 1 month ago

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

lbrooney commented 3 weeks ago

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.