Page action button (in address bar) does not display if tab is in no container at all
- Temporary Containers Version: 1.9.2
- Firefox Version: 115.13.0 (Floorp 11.15.0)
Actual behavior
No page action button when tab does not have container
Expected behavior
The page action button to be present even when a tab is not in a container
Steps to reproduce
- Open a tab outside any containers (you can use the Sideberry extension, for instance, to do so)
- Observe lack of button, even with option enabled
Notes
It seems to be this code that causes the problem:
https://github.com/stoically/temporary-containers/blob/cbb39f7abbdf3c767bd1fbdc109394a0db169b05/src/background/pageaction.ts#L43-L45
I see in the debug console for the background page this error:
I can't replicate this behaviour. I assume you are talking about the button that appears within the address bar with the advanced option "Show icon in the address bar that reveals the popup" enabled? If you open a new tab that button wont appear until you have loaded a url in the tab regardless of if it is a TC or not, is that what you mean? If not can you provide further details on how to replicate the issue?
For a tab in a container, behaving as expected (in this case, a Github site):
For a tab in the default container (or no container?) this issue:
I'm not sure what else there is to it? For most of my container management, I'm using Sidebery, and the 'default' container here is what it shows here:
The stack trace in my previous comment is still the same, and manually invoking the relevant APIs from the console reproduces the error:
A little more debugging on my end reveals that this is an issue with the computation of containerPrefix. It computes the name based on .name.toLowerCase() of browser.runtime.getBroswerInfo(), but that seems to be wrong for Floorp. Here's the browser info object returned there:
Though actually, it's getting it from a tab cookieStoreId, and that's what's failing. Poking around Sidebery suggests that it doesn't treat firefox-default as a container, and it seems like that's the correct way to deal with this?
but is that only when you open the default container before opening a URL or is it also missing after you have loaded a URL?
Also after loading a URL. (I do not have automatic temporary containers enabled.)
A little more debugging on my end reveals that this is an issue with the computation of
containerPrefix. It computes the name based on.name.toLowerCase()ofbrowser.runtime.getBroswerInfo(), but that seems to be wrong for Floorp. Here's the browser info object returned there:
Ah ok, this will be the problem. If the tab doesn't have a container it should be detecting the firefox-default cookieStoreId but in your case the containerPrefix variable is calculating the default container as something different. This is likely causing other problems for you as the same way of identifying the default container is used elsewhere. Ideally this should be fixed as part of calculating the containerPrefix variable but this will affect other users besides you. I can add a catch all to the container check for this particular error (which should be throwing an error anyway).
I've applied a fix for now here https://github.com/GodKratos/temporary-containers/commit/5e693b236aa814afb4db2f859d0ed1ce327b6625