multi-account-containers icon indicating copy to clipboard operation
multi-account-containers copied to clipboard

Option to open new Tabs in the same Container

Open MichelZ opened this issue 7 years ago • 99 comments

I often CTRL+T to open a new Tab. Currently, these are opened in the Default Container. It would be nice to at least have a configurable option to open new Tabs in the Context of the Tab I'm currently working on.

I am a system admin, and I do need to use different personas, often even for the same sites. Also, when I am working with one persona, I often need multiple tabs for the same persona, so this would help me not needing to change the persona on every new tab.

As mentioned above, saving the URL to always open in the same Container does not work for me, as the same site needs to be used with multiple personas.

MichelZ avatar Apr 25 '17 06:04 MichelZ

I've suggested in test pilot feedback to be able to open with Ctrl/Cmd + T a new tab without container, then add Ctrl/Cmd + T + n (where n is a number) to open a new tab in the numbered container (by order in the list).

Another option may be to show another "new tab controls" option to see possible containers, then bind a key to each container, so we can open with Ctrl/Cmd + T then the key (better for fingers & accessibility, because some combinations like Ctrl/Cmd + T + n are not easy with only one hand)

Nainterceptor avatar Apr 27 '17 10:04 Nainterceptor

@Nainterceptor Your suggestions are as valid as anybody else's, but please don't take the focus away from @MichelZ's idea, which is simply to make new tabs open in the same container as the current tab with the 2-key shortcut we've been used to for many years.

anewuser avatar Apr 27 '17 11:04 anewuser

@anewuser Mhhh, nevermind, I've understood "vote for me" label as an open debate, I've seen a feature close to the one that I want, and I try to add my idea to this one. So, I guess that is not open to comments.

Nainterceptor avatar Apr 27 '17 11:04 Nainterceptor

Typing in the location bar and hitting alt+enter should definitely open in the same container, regardless of this particular request's outcome.

WhyNotHugo avatar May 10 '17 04:05 WhyNotHugo

Also just clicking the "new tab" button should open the tab in the same container. Maybe the color of the + can be changed to the current container color.

TitanNano avatar May 25 '17 18:05 TitanNano

I'm pretty sure this needs code in m-c. I can't seem to get the right combination of tab event handlers to make this work in a browser extension. Here's where I'm trying:

https://github.com/groovecoder/new-tab-same-container

groovecoder avatar Jul 21 '17 02:07 groovecoder

@groovecoder can you not combine: https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/webNavigation/onCreatedNavigationTarget

with a blocking onBeforeRequest?

I will try and make a sample tomorrow, looks like 54 supports this and it should be better for assignment also. This is neater for this solution as I think you will be able to check the cookieStoreId for the frame the request came from.

jonathanKingston avatar Jul 21 '17 03:07 jonathanKingston

Hmm ... the onCreatedNavigationTarget specifically DOES NOT fire when the user creates a new tab.

The event is not sent if a tab or window is created without a navigation target (for example, if the user opens a new tab by pressing Ctrl+T).

So, it could work, but the tab won't switch into the container until the user makes a navigation request, which isn't what this particular issue is asking for.

groovecoder avatar Aug 01 '17 16:08 groovecoder

I wonder if on tab created that is default should just open in the current container if there is one would be good enough here. And perhaps the navigation target could be an exemption to this rule?

jonathanKingston avatar Aug 22 '17 10:08 jonathanKingston

Note: check out https://github.com/kesselborn/taborama which is implementing this.

groovecoder avatar Sep 05 '17 13:09 groovecoder

I'm +100 on this, although I understand the current default behaviour. Just an alternative keyboard shortcut would do. Like @hobarrera I think ctrl + enter should open in the current currext.

BUT.

For the people currently looking for a workaround, you must know that CTRL + Click or middle click on the "new tab" (the plus sign) button will open a tab in the current context. It helps a lot already.

sametmax avatar Sep 17 '17 14:09 sametmax

CTRL/CMD+Click or Middle click won't work for users like me that have hidden the tab bar.

I've hidden the tab bar because I like my tabs on the side, ala Tab Center, so I don't actually have a tab button to click anywhere.

I'm willing to rewrite years of muscle memory for a shortcut for a context aware new container tab, but first prize would definitely be for Firefox to assume that the current container I'm in is the current container I wish to stay in.

My main reason for this is; consider Google style properties where you have a single account across many many services. I'm viewing something on youtube in my personal container, and then decide to read my personal email, so I open up gmail, except it opens up in the default container which is isolated from my personal container, and thus requires another auth.

This is extremely confusing, and moreover, surprising.

gee-forr avatar Oct 02 '17 11:10 gee-forr

After discovering and installing this add-on, I up'ed and followed this issue. Now, after using it for a few weeks, I feel like I have a better understanding of this feature, and the enhancements that would make it perfect for my browsing behaviors.

I now disagree with my original assumption and now think that new tabs and windows should always open in the default container. To go one step further, I think that the option to open new tabs in the same container would muddle this feature and would make it more difficult for new users to understand containerization (and that its strictly not related to about:profiles or about:accounts).

Now what I desire is a seemless way to switch my current tab to another container. This could be something like https://github.com/mozilla/multi-account-containers/issues/849, (where I'm prompted for a choice if I go to a url that's assigned to multiple containers) or it could just be a keyboard shortcut that reloads my current tab with a different container.

Anyways, I'm going to unfollow this issue but thought I would voice my thoughts before I leave.

Edit: I just saw https://github.com/mozilla/multi-account-containers/wiki/Moving-between-containers which eliminates the reloads idea but I believe a prompt before loading the URL could still be viable.

crenwick avatar Oct 02 '17 16:10 crenwick

@crenwick It's great that it works fine for you, but a lot of other people in this thread do need/want this feature, so I don't see the point of your comment (you hadn't commented here before) other than to unmotivate us.

anewuser avatar Oct 02 '17 19:10 anewuser

I don't mean to unmotivate, just wanted to provide my perspective to the discussion I've been following.

crenwick avatar Oct 02 '17 20:10 crenwick

… taborama … implementing this.

Spin-off: https://discourse.mozilla.org/t/-/15331/4?u=grahamperrin

grahamperrin avatar Oct 03 '17 19:10 grahamperrin

For me it'd be best if there was an option to ditch the "default" container altogether. It just doesn't fit. I have a container for pretty much every use case I need, which means if I open tabs in "default" container it's clearly a sign that I forgot to pick a container (or firefox forgot to assign one). This solves the original problem in here in a pretty straight forward way: If default container is no more, firefox has to ask me what container to assign every time I open new tab. The method to do that is pretty much out of scope, but it could be:

  • multiple shortcuts (Ctrl + T, Y, U, ..)
  • context menu
  • custom tab that makes me assign it's container before it "transforms" into new tab
  • ... ability to choose another default container from the set of already defined

tkolo avatar Nov 03 '17 13:11 tkolo

CMD+T opening a new tab in the default container instead in the container I'm currently in keeps me from using Firefox and I so really much would like to. I 100% agree and second the original issue description.

aleksijohansson avatar Nov 15 '17 09:11 aleksijohansson

Anyone knows what the current status here is, especially for keeping [Alt]+[Enter] in the same user identity?

Thanks, --Neno

NenoLoje avatar Jan 18 '18 12:01 NenoLoje

Been a long time since this was requested... alt+enter and ctrl-t should both use the current container... or even better, let us set a 'default container' for those operations !!

chicagobuss avatar Feb 01 '18 19:02 chicagobuss

This feature request already seems to be solved by jkt? -> https://addons.mozilla.org/en-US/firefox/addon/new-container-tab/

I use this extension all the time. Essentially it does what is being asked on this issue but instead of Ctrl+T it uses Alt+C which I think is a reasonable solution. I like the idea of Ctrl+T always being the non-container option because I often want both so it taking over Ctrl+T would be a negative in my opinion.

MichaelTunnell avatar Mar 01 '18 03:03 MichaelTunnell

@MichaelTunnell Please read the previous comments. Many of us don't want to use another shortcut.

so it taking over Ctrl+T would be a negative in my opinion.

That's why things can be optional.

anewuser avatar Mar 02 '18 17:03 anewuser

How do you people actually use this extension without this?

jurf avatar Mar 02 '18 18:03 jurf

I think the safe (paranoid) option is that "no container/default container" means the tab is opened in it's own temporary container. it should then be fine to move the tab to an existing container after the fact. This is the paranoia option though, and cannot be the default. I usually use private windows anyway even if it means I have to log in often. (I wish "open in firefox" meant opening in a private tab even.)

kaleissin avatar Apr 06 '18 09:04 kaleissin

Maybe another approach would be extending the convenience of the existing Ctrl+. shortcut by automatically focusing the current tab's tab group? Then, only Ctrl+. and Enter would be enough to open a new tab in the same container.

fxedel avatar Jun 26 '18 17:06 fxedel

So, point for discussion: I've just written an add-on which does this.

https://addons.mozilla.org/en-US/firefox/addon/sticky-containers/

This is the first Firefox add-on I've written, and the first thing using WebExtensions, so I make no promises that I'm not mangling something, or missing some important cases. But.

I felt the earlier-mentioned new-container-tab extension was insufficient for what I wanted because there wasn't a way to have it bind to the regular ctrl-T shortcut, and it didn't affect links coming in from outside Firefox. I want to click a link in my work IRC client, and have it open in the Work-profile Firefox window I have on that desktop, basically.

kemayo avatar Jun 27 '18 04:06 kemayo

@kemayo Your add-on doesn't work for me, I'm running 62.0b2.

Unchecked lastError value: Error: Missing host permission for the tab background.bundle.js:23
tab onActivated Object { tabId: 16, windowId: 3 } background.js:57:3
cookieStoreId changed from firefox-default -> firefox-container-1 background.js:42:7
tab onActivated Object { tabId: 28, windowId: 3 } background.js:57:3
Unchecked lastError value: Error: Could not establish connection. Receiving end does not exist. background.js:155

TitanNano avatar Jun 27 '18 08:06 TitanNano

@TitanNano: Not sure what's happening there. Both of those errors reference files which aren't in my extension, so I think they might be red herrings. It's plausible that I just need more permissions, and for some reason I'm not seeing that being a problem locally. (Either because of some extension development quirk, or because I'm using release-firefox rather than 62.) As such... I've put up a new version which asks for <all_urls>, as a magic incantation against "missing host permission".

kemayo avatar Jun 27 '18 08:06 kemayo

There are many people subscribed to this issue only to get updates on an official "Option to open new Tabs in the same Container".

Please stop posting things about extensions here, and report their bugs to the appropriate repositories or support forums.

anewuser avatar Jun 27 '18 17:06 anewuser

There are many people subscribed to this issue only to get updates on an official "Option to open new Tabs in the same Container".

There are also people who are subscribed for a solution of any kind, official addon or not. So I hope people continue to post extensions they've made for any of the issues in this repo.

However, I do agree that bug reports should just be on the issues portion of the extension repo not here.

MichaelTunnell avatar Jun 27 '18 23:06 MichaelTunnell