kemayo/firefox-sticky-containers

CTRL-T doesn't always open a new tab of the currently selected container type

Opened this issue · 8 comments

Hi David - thanks for putting this add-on together!

I'm running Firefox 60.0.2 (64-bit) on Xubuntu 18.04 with firefox-sticky-containers 1.0.1. I need to find a simpler reproduction of the following bug, but for now, here's what I have.

I have two browser windows open, each with a selection of non-container tabs and container tabs; the container tabs in each window are of one type.

My first interaction with firefox-sticky-containers after install was to select a green container tab and then click a URL in the Telegram app from the PPA at http://ppa.launchpad.net/atareao/telegram/ubuntu. As expected, the URL opened in a the right window in a green container tab. Outstanding!

I next gave the other window (containing some red container tabs) focus, selected a container tab and issued CTRL-T.

The tab which opened was a non-container tab (in the browser window which had most recently had focus).

I expected CTRL-T to open a new red container tab in the current browser window.

I'm wondering if the fact that the very first thing I opened was an URL in an external app had something to do with it.

Sorry, I need to ask for a few clarifications:

I next gave the other window (containing some red container tabs) focus, selected a container tab and issued CTRL-T.

Here do you mean you selected a different tab to the one which was active when you focused the window?

The tab which opened was a non-container tab (in the browser window which had most recently had focus).

By "the browser window which had most recently had focus" do you mean the currently-focused red-tabs window, or the previously-focused green-tabs window?

Hi David - sorry for the lack of clarity.

Here do you mean you selected a different tab to the one which was active when you focused the window?

Yes. As far as I remember the tab that had focus in that window was a non-container tab. I selected a container tab in the same window and then hit CTRL-T. The tab that opened was a non-container tab.

By "the browser window which had most recently had focus" do you mean the currently-focused red-tabs window, or the previously-focused green-tabs window?

I mean the red container tabs window.

Thanks for taking the time to look into this. I'll try to put together a simpler scenario which repros the issue I'm seeing - which is that CTRL-T opens a plain vanilla non-container tab, irrespective of whether the last tab selected was a container tab or not (...when using either two or more browser windows, or a mix of container tabs and non-container tabs - this latter condition has yet to be tested to find out if it's relevant.)

@benklaasen did you enter any URL after opening the tab? Because the container is only applied once a navigation occurs.

@TitanNano the navigation includes the initial “navigating to about:blank/newtab”, however. It should be working immediately when a new tab opens.

@kemayo that doesn't work for me. It only gets containerized once I start navigating away from about:blank/newtab. All gecko tabs are created with about:blank so there should never be a navigation event. One thing that could be done here is to listen to tabs.onCreated instead of the onBeforeNavigate event.

@TitanNano: Weird. I wonder what the difference is between our configurations. So, the problem with onCreated is that the tab doesn't know its URL yet, if it's opening from an external link -- which means recreating the tab with a container is going to just make a blank tab. (That gets applied as a navigation event later.)

did you enter any URL after opening the tab? Because the container is only applied once a navigation occurs.

@TitanNano I hit CTRL-T, expecting the new tab to immediately show that it has 'inherited' the container type of the last-selected browser tab. I then ALT-D to the (urgh) awesome bar and type the URL I want to get to.

@kemayo I've also seen some other super-weird behaviour when rapidly clicking to close tabs (containerised or not) - I see new tabs appearing! That's a separate bug that I can log if you're inclined to spend more of your free time for the benefit of entitled strangers on the Internet! ;-)