mozilla / multi-account-containers

Firefox Multi-Account Containers lets you keep parts of your online life separated into color-coded tabs that preserve your privacy. Cookies are separated by container, allowing you to use the web with multiple identities or accounts simultaneously.
https://addons.mozilla.org/firefox/addon/multi-account-containers/
Mozilla Public License 2.0
2.64k stars 325 forks source link

Option to open new Tabs in the same Container #462

Open MichelZ opened 7 years ago

MichelZ commented 7 years ago

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.

bettyvschmartz commented 3 years ago

making users change to using a different shortcut seems like a bad cx for the feature. ctrl + t is the simplest way other than clicking the button.

Agreed @moontails. I'm not sure about the window default though. I'm not using tabs across windows personally. As @Roy-Orbison sums up:

you're in a tab in container X, you open new tab, it's in container Y (or none), either way not the "current" container.

My logic is clicking a link that should open in a new target window/tab opens a tab in the same container, so the current container is assumed to be the default in this context. Therefore, I think hitting ctl + t should also assume the current container to be the default context and open a new tab in that container. The user then has the several ways to open a new tab in another container including:

As well as other methods.

Generally it's my view that you're going to be working in a session and when you ctrl + t you're more than likely wanting to do something in that session. If not, you're at least not wanting a containerless session.

-- BVS

grahamperrin commented 3 years ago

https://github.com/mozilla/multi-account-containers/issues/462#issuecomment-730317663

… :pleading_face: Sticky containers would do the job, but it's broken.

I don't know about breakage but https://github.com/mozilla/multi-account-containers/issues/319#issuecomment-586018080 @andrewleech draws attention to:

Sticky Window Containers

Tabs open in the same container as the first tab in the window.

Roy-Orbison commented 3 years ago

I attempted to make a basic web extension to get around this issue. It's not a real solution because I can't see any API to set a tab's container before it's created, nor does Firefox seem to distinguish a tab created explicitly with the default container from one without a specified container, which makes it cumbersome to create a container-less tab in a window where none already exist.

If anyone has a better idea, feel free to share it!

MichaelTunnell commented 3 years ago

I attempted to make a basic web extension . . . If anyone has a better idea, feel free to share it!

would it be worth it to fork and update this extension? https://addons.mozilla.org/en-US/firefox/addon/new-container-tab/

Roy-Orbison commented 3 years ago

would it be worth it to fork and update this extension?

No need to fork or update, it works, and it's definitely better than mine.

MichaelTunnell commented 3 years ago

the only thing that worries me about that extension is that jkt hasn't updated it for 4 years and hasn't updated any of his extensions in over 2 years so if it does break, that will likely be the end of it.

Christopher-Hayes commented 2 years ago

I would find a per-window default to be very useful. Keeping work and personal container tabs in different windows is my personal preference. But, if opening a new tab would use whatever container the active tab has, that would work just as well.

Not sure why Mozilla doesn't reopen PR #990 since the Bugzilla issue has gone stale.

achernyakevich-sc commented 2 years ago

It looks that this discussion mainly split to either implement opening the same container for Ctrl+T or do not implement it this way. For me it looks that at the moment (I have installed 7.4.0) we already have quite useful and convenient shortcuts like Ctrl+Shift+1, Ctrl+Shift+2, Ctrl+Shift+3, etc. giving a chance to open new tab that belongs to the numbered container.

Maybe we could make life easier and implement shortcut Ctrl+Shift+0 that will open new tab that will belong to the same container that current tab belongs to.

What do you think about it?

Christopher-Hayes commented 2 years ago

@achernyakevich-sc Oh, I didn't know about the Ctrl+Shift+# shortcuts, that makes my life quite a bit easier.

achernyakevich-sc commented 2 years ago

@achernyakevich-sc Oh, I didn't know about the Ctrl+Shift+# shortcuts, that makes my life quite a bit easier.

So this is just convince me that introducing Ctrl+Shift+0 for opening new tab in the same container as current page is quite good proposal that just will support existing user experience. :)

From other side it should be easy to implement because:

So look as developers need slightly combine functionality that already presented in the add-on. :)

moontails commented 2 years ago

alright, recent activity off late confirms my faith that user exp dissonance wasnt felt just by me.

yes i think the end user experience should be a simple shortcut! i love the tool and this will just further elevate using it every time or at least i think so 😌

happy to be involved in designing and implementing this ✌🏽

achernyakevich-sc commented 2 years ago

@groovecoder Maybe you could pay attention to my comment and let us know is t reasonable or now and has it chance to be implemented or no?

Roy-Orbison commented 2 years ago

@achernyakevich-sc Ctrl + Shift + 0 is already allocated to the 10th container. If you don't have that many, you wouldn't have known.

This issue isn't about assigning a different shortcut to open a new tab in the current container, an extension already exists for that, and you can assign whatever shortcut you want to it. It's about (at least having a preference for) retaining the current context when opening a new tab using the normal interface/shortcuts. This is so it becomes a conscious choice to leave the current context rather than having the distraction of checking which context you're in, and opening a new tab that matches it.

achernyakevich-sc commented 2 years ago

@achernyakevich-sc Ctrl + Shift + 0 is already allocated to the 10th container. If you don't have that many, you wouldn't have known.

Be frankly no matter because for container number 11 you already have no shortcut. So it is not a problem that you will have no for the container number 10. :)

As well you could compare it with Firefox tabs selection functionality: Ctrl+1 selects the first tab, Ctrl+2 - the second, ..., Ctrl+8 - the eighth, Ctrl+9 - the last one, Ctrl+0 is not related to tabs selection even if you have ten plus tabs available. :)

This issue isn't about assigning a different shortcut to open a new tab in the current container, an extension already exists for that, and you can assign whatever shortcut you want to it. It's about (at least having a preference for) retaining the current context when opening a new tab using the normal interface/shortcuts. This is so it becomes a conscious choice to leave the current context rather than having the distraction of checking which context you're in, and opening a new tab that matches it.

Here I would propose to be more pragmatic otherwise it will be still at the point it was 4 years ago.

People have problem - they would like to open new tab keeping the same container. So at the moment we have two options:

And having implemented shortcut approach topic could be continued to be discussed.

I just would like to simplify some people's life. :)

Roy-Orbison commented 2 years ago

@achernyakevich-sc

Be frankly no matter because for container number 11 you already have no shortcut. So it is not a problem that you will have no for the container number 10. :) and

I have exactly 10 containers so that would be a breakage for me and everyone else who has 10+ containers.

As well you could compare it with Firefox tabs selection functionality: Ctrl+1 selects the first tab, Ctrl+2 - the second, ..., Ctrl+8 - the eighth, Ctrl+9 - the last one, Ctrl+0 is not related to tabs selection even if you have ten plus tabs available. :)

I do like consistency, though.

People have problem - they would like to open new tab keeping the same container. So at the moment we have two options:

  • give them reasonable shortcut that they could easily remember (e.g. Ctrl+Shift+0 - similar to opening numbered containers) - it is easy to implement.

As I said before, we already have that. There's an extension to do it, and you can already use Ctrl + Shift + 0 if you wish. Just delete it from the containers extension first:
Screenshot_20210817_102340

  • try to override default behavior of Firefox - that looks not easy because issue stay open for last four years.

That is (and always has been) what this bug is about, because it can't be done by the user:
image

achernyakevich-sc commented 2 years ago
  • try to override default behavior of Firefox - that looks not easy because issue stay open for last four years.

That is (and always has been) what this bug is about, because it can't be done by the user: image

Pay attention that I used the word issue and not a bug. Mainly because this is not a bug.

Multi-account-containers is just the add-on. So it is restricted by the product it is created for, its API and customization capabilities. At the moment (as far as I understand) there is no clean and straightforward way to override a Firefox shortcut like Ctrl+T that in reality is a core part of browser functionality. So either we understand it and leave having accepted this fact and having solution for it (in our case through introducing other reasonable shortcut, e.g. Ctrl+Shift+0) or... four years discuss unchangeable.

I vote for the first one.

P.S. My Lord, give me the power to change what I can change. Give me the patience to accept that I can't change. And give me the sense to distinguish between these.

bettyvschmartz commented 2 years ago

So either we understand it and leave having accepted this fact and having solution for it (in our case through introducing other reasonable shortcut, e.g. Ctrl+Shift+0) or... four years discuss unchangeable.

I understand your point about voting for something that is more likely to pass but I don't see the logic in the solution. For example, you propose as an alternative to use ctrl+shift+0 but as @Roy-Orbison alluded to, I don't see how this is better than what we already have. If I'm in container tab 1, I can just as easily press ctrl+shift+1 to get a tab in the same container. I don't see any particular extra mental effort to also think, container tab 2, press ctrl+shift+2 and so on. This exists. I know you're saying have ctrl+shift+0 as default to take the current container as the new container context but you're not saving any key presses and it's also not core browser functionality, or expected behaviour.

Here the point is for ctrl+t, which is a standard shortcut, to respect the current container context. This add-on is partly a privacy and anti-tracking tool so users purposely keep their browsing sessions separate. When you click a link in a container tab it opens a tab in the same container and so IMO the same should apply to ctrl+t. The last thing a user wants is to think they're nicely separating their sessions and then open a new tab, start browsing, only to realise they're back in a none container session.

-- bvs

achernyakevich-sc commented 2 years ago

@bettyvschmartz

Here the point is for ctrl+t, which is a standard shortcut, to respect the current container context. This add-on is partly a privacy and anti-tracking tool so users purposely keep their browsing sessions separate. When you click a link in a container tab it opens a tab in the same container and so IMO the same should apply to ctrl+t. The last thing a user wants is to think they're nicely separating their sessions and then open a new tab, start browsing, only to realise they're back in a none container session.

I completely agree that ideally Ctrl+T should honor container that current tab is open in. But is it technically possible to achieve it on the level of the multi-account-containers extension? It is just extentsion and can only do that Firefox will permit. But if you will be able somewhere convince developers of Firefox that they should do it - let me know. I will be in the first row of people who will vote for it. :)

Meantime Ctrl+Shift+0 is really solving problems of the most people who talks here and has similar issues.

Concerning easy to remember 10 shortcuts and their assignment per container I would disagree. :) At first you need to remember at second to apply correct you need to switch your attention out of page context, looks which container used for the page and get from mind what is assigned shortcut for this container. Quite a lot so simple Ctrl+Shift+0 will be preferable to my mind even if I have only two container configured. :)

But... it looks that discussing in this issue looks not valuable and I'm going to create new one that will explicitly ask for introduction Ctrl+Shift+0 shortcut to open new page in the same container. As soon as I will have it created I will return and point where to vote for that issue. :)

Roy-Orbison commented 2 years ago

the only thing that worries me about that extension is that jkt hasn't updated it for 4 years and hasn't updated any of his extensions in over 2 years so if it does break, that will likely be the end of it.

@MichaelTunnell There were some unresolved issues in that repo. I gave it a revamp and submitted it to AMO. It's currently awaiting review but the wait time is up to 4 weeks. Hopefully it'll be It's been published at https://addons.mozilla.org/en-US/firefox/addon/retainer/ soon. For now you can try it from https://github.com/Roy-Orbison/Retainer/releases/download/v0.1.0/retainer.xpi. You'll need FF Dev Edition & to toggle the xpinstall.signatures.required config value to do so.

Its toggleable preference to avoid opening in "no container" should keep it relevant even if Ctrl + T gets a pref/behaviour change. It may even suffice to solve @Christopher-Hayes' desire for a window-level default as long as one limits each window to a single container.

achernyakevich-sc commented 2 years ago

the shortcut option is not productive. Ctrl+Tab in active container will be killer feature.

I would say - it "could be". But as I mentioned earlier Ctrl+T is default shortcut of Firefox itself and it looks it could not be changed from inside Add-On. So we are faced the fact either Ctrl+T almost no chance to be implemented or implement Ctrl+Shift+0 with minimal efforts. What you will chose? :)

adamgit commented 2 years ago

Without Ctrl-T it's essentially pointless - either this is integrated properly with the browser, or ... it just doesn't really work. The vast majority of users are neither going to know nor (even if told about it) remember a wholly new - and 3-button! - shortcut.

They are going to accidentally open things in the wrong context repeatedly. IMHO this is arguably - to some extent - a nail in the coffin for Containers: moderately high negative impact/risk, high probability of happening sooner or later to most/all users. Personally it's the one reason I've continued to run Chrome for the last 5 years: because Firefox doesn't have this core essential feature and for a lot of browsing I cannot afford the time it wastes and/or risk the mistakes it causes. So I can use Firefox for a few things, but 90% of my browsing is in (a browser I don't want), but it's a browser that doesn't expose me by encouraging me to mess-up this basic item.

achernyakevich-sc commented 2 years ago

Alt+T - is busy and leads to Tools system menu item. Ctrl+Space - is often busy by other plugins, in my case Simple Translate shows translation for selected text. I have seen other Add-Ons that use the same for autocomplition, etc.

But as Ctrl+Shift+<number> is already used by MAC to create new tab in numbered container then it is quite native get learned that Ctrl+Shift+0 will open new tab in the same container as current tab uses. :)

Roy-Orbison commented 2 years ago

Can we please have fewer repeat suggestions in the thread? This isn't about who can choose the best shortcut.

awmartin commented 2 years ago

As for container-specific shortcuts, Ctrl+Shift+<number> does not work for me on macOS, but Cmd+Shift+<number> does, which unfortunately interferes with the system-wide standard screenshot shortcuts: Cmd+Shift+3, Cmd+Shift+4, and Cmd+Shift+5. There's no way to customize these in Firefox 94, as far as I can tell.

I'd much rather disable them in lieu of this add-on, which adds Alt+Shift+ on macOS, the only thing that works for me.

Edit: Found this comment to customize the container-specific shortcuts. Withdrawing my comment as irrelevant to the original issue.

nk9 commented 2 years ago

If there were an appropriately-named menu item, say "File > New Container Tab > In Current Container", then users could bind this menu item to whatever keyboard shortcut they wanted. On macOS this ability is built in.

As it stands, the contextual menu in the tab bar has "New Tab," which opens a new tab in the current container. But the identically-named "File > New Tab" menu item uses no container. I personally find this a bit unexpected. If the behavior of the two items is going to be different, IMO it would be clearer if the context menu said "New Tab in Current Container".

Roy-Orbison commented 2 years ago

@nk9 That functionality is already available via an add-on, and Firefox has the ability to edit extension key bindings.

This issue is and always has been about making it possible (and preferably the default) for Ctrl + T to keep the current context. This is because loss of context is unexpected, that key combination cannot be bound to anything else by users, and we should not have to mess with key bindings for basic functionality, regardless.

DanKaplanSES commented 2 years ago

I wasn't able to glean this, though I admit I haven't read every comment: is there an existing Firefox issue for overriding ctrl+T? Can someone reply with a link to it, and then maybe @MichelZ can add it to their original post for visibility. I guess I'm assuming they have a voting system, too.

Roy-Orbison commented 2 years ago

Mozilla bug #1320332

mrassili commented 2 years ago

I was able to produce the wanted behavior using a combination of Karabiner Elements and @jonathanKingston's extension

vlad0337187 commented 2 years ago

@nk9 That functionality is already available via an add-on, and Firefox has the ability to edit extension key bindings.

This issue is and always has been about making it possible (and preferably the default) for Ctrl + T to keep the current context. This is because loss of context is unexpected, that key combination cannot be bound to anything else by users, and we should not have to mess with key bindings for basic functionality, regardless.

Thanks, that helped me a lot. Assigned new tab in same container to CTRL-E.

VasuInukollu commented 2 years ago

Assigned new tab in same container to CTRL-E.

I am not able to set CTRL E as the shortcut. Is there any trick to do this? When I try, I get this message "Can't override a Firefox shortcut".

archon810 commented 1 year ago

@nk9 That functionality is already available via an add-on, and Firefox has the ability to edit extension key bindings.

Thank you for the link, it's working as expected. I customized the shortcut to Ctrl+Alt+T.

daraul commented 1 year ago

I often open URLs from some other application, that indeed are meant to be opened in some container. I am normally already using some tab in that container when this happens. Therefore, I would prefer a configuration setting that tells Firefox to open any new tab in the container of the current tab.


If anyone is interested: I worked around the lack of this feature with stick window containers, but the extension caused some annoyances that lead me to remove it.

rykel commented 7 months ago

I am not a developer, but I would like follow this issue because I would like to open multiple tabs in the same container. Thanks for all the hard work, devs.

arunvelsriram commented 6 months ago

I came across Firefox Autoconfig when I was researching about overriding Firefox default shortcuts.

Using Autoconfigs I was able to override Cmd+T to open new tabs in a specific container (container 0 in my case). The scripts are available here:

autoconfig.js autoconfig.cfg

These can be modified to open tabs based on the current tab's container. Even these can be modified to override the behavior of the New Tab (+) button as well I guess.

In case of OS X place or symlink the configs in below location: /Applications/Firefox.app/Contents/Resources/autoconfig.cfg /Applications/Firefox.app/Contents/Resources/defaults/pref/autoconfig.js

Tip: Use Browser Tool Box (Cmd+Option+Shift+I) for debugging the scripts

References: https://superuser.com/a/1747680/244485 https://superuser.com/a/1785959/244485 ( these answers were great) https://github.com/Theemim/GeckoAutoconfigIntro#mike-kaply-articles https://www.reddit.com/r/firefox/comments/p89mvd/how_can_i_make_the_browser_toolbox_visable_in_the/

Roy-Orbison commented 5 months ago

Thanks @arunvelsriram for that. I'm almost tempted to give it a try. At least it adds weight to this issue because users should not have to go through that much rigmarole to have a sensible shortcut.

altynbek132 commented 4 months ago

Hi all, you can use Tree Style Tab extension for this with setting on picture image

VasuInukollu commented 4 months ago

Hi all, you can use TST for this with setting on picture

finally something that works

Roy-Orbison commented 4 months ago

Tree Style Tabs uses a bit of hack:

  1. It observes all tabs being opened
  2. Assesses whether it thinks they are "new tabs"
  3. When the last active container was not the default/"no container", it opens another tab with the container set
  4. It then closes the original tab you opened

It's not a bad hack but it doesn't solve the core issue, and it's not quite the same as opening a new tab with the container already set (as Retainer does). It's relatively heavy if all you use it for is to keep the current context.

Reference.

DanKaplanSES commented 4 months ago

Tree Style Tabs uses a bit of hack:

@Roy-Orbison Thank you for expanding that acronym. I wasn't aware of what it stood for.

/cc @altynbek132

jwbth commented 3 months ago

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

Ctrl+T doesn't bother me as much as Alt+Enter. My typical use case is that I change some part of the URL and want it to open in the same container, but in a new tab. And there seems to be no way I can do it. If the devs, for some reason, prefer to keep the old behavior for Alt+Enter, then please provide a modifier like Ctrl, Shift, middle click or whatever. Are they all occupied or what? Damn, I can't even make a middle click on the arrow button, like I do with the "+" (New tab) button, which makes the address bar totally misleading: image The new tab won't be opened in the "Personal" tab, despite what the address bar says, no matter if you make a middle click or hold a modifier. With Alt, it just opens the URL in the same tab.

AdamWill commented 3 months ago

Another vote for something like this. What I actually want is the exact behaviour of the Sticky Window Containers extension, but without having to install an extension from a random author which has not been updated for three years (and is probably a prime target for a takeover attack) to get it. I want all tabs in a given window to open in the same container by default, including if I have that window active then click a link from another application, or middle-click a link from another tab in that window. Not sure if that counts under this issue, or there's another request for that. Thanks.

Roy-Orbison commented 3 months ago

@AdamWill I fully agree with your desire for better containment, but a lack of plugin updates can also indicate stability. If it doesn't have open issues, and it's working for you, it probably doesn't need to be updated. Simple plugins don't provide much of an attack surface. Mine's literally listen for a shortcut event (provided by Firefox, not it monitoring keystrokes), then open a tab.

AdamWill commented 3 months ago

Fair point.

mattolenik commented 3 months ago

Another vote for this. It is SO easy to accidentally open something in the wrong container. If I'm "in a container" I would expect new tabs to be in the same container. The mental overhead of having to explicitly put care into opening new tabs for each container makes the whole thing kind of useless, unfortunately. This seems like a no-brainer from a user interaction point of view. It's the most top voted issue for a reason.

MakeYourselfVisible commented 5 days ago

came here to suggest this feature. I hope someone does it! 🙏 I would but my coding skills beyond CSS and HTML are 💩🤣 happy to help test though :P