6

I'm using multi-account containers in Firefox to keep my tabs separate from each other. I'm looking for a way to open new tabs in specific containers.

Using Cmd+T opens a new tab in a default container. A long click on the new tab button shows a dropdown menu of available containers and I can choose one from that list. I'd quite like to be able to do it from the keyboard though.

I've set up some domains to open in specific tabs but it's things like Gmail that doesn't work for. I have separate containers for personal and work Google accounts and want to be able to go directly to either of them.

Is there a command-line option to do this? If that was the case I could set up a third party app (such as alfred) to call Firefox with such an option to set the container.

2

3 Answers 3

4

Is there a command-line option to do this?

An extension is currently required to make this work…

Install the open-url-in-container extension. It's a rather simple extension and works very well. It is open-source with all of its code on GitHub: honsiorovskyi/open-url-in-container

Now, you can use URIs of the form ext+container:name=${CONTAINER_NAME}&url=${ORIGINAL_URI} to open an arbitrary URI in an arbitrarily-named container. Works via command-line invocation, entering them in the location bar, or links from other pages.

1
  • 1
    This didn't work for me until recently because I was using the original/experimental version of the multi-container add-on. I've just switched to the normal one and it works perfectly!
    – Matt
    Commented Jun 5, 2022 at 18:53
2

Ctrl + . is the default shortcut to open the containers panel.

I found this by doing the following:

  1. navigate to the Add-ons dashboard (Tools --> Add-ons or Super + Shift + A on mac)
  2. click the gear at the top of the list
  3. click "Manage Extension Shortcuts" (this lists all shortcuts for all extensions)
3
  • What is it that you see when you press Ctrl + .?
    – Matt
    Commented Sep 2, 2019 at 8:58
  • 1
    @Matthew all my containers, same as if I long-pressed the new tab button. i can then arrow up or down to open a tab with the container i want. what do you see?
    – crogers
    Commented Sep 4, 2019 at 2:46
  • better yet, what do you see when you follow the instructions in my answer? so go to Tools --> Add-ons --> click the settings gear --> "Manage Shortcut Extensions" (you might have another extension with a conflicting shortcut -- 1password, for example, has the same default shortcut)
    – crogers
    Commented Sep 4, 2019 at 2:48
0
  1. Install the open-url-in-container extension.

  2. On Windows modify command line to the Windows registry under

    HKEY_CLASSES_ROOT\FirefoxHTML\shell\open\command

    HKEY_CLASSES_ROOT\FirefoxURL\shell\open\command

If you change the -url in the command line to ext+container:name=MyContainer&url=

from

"C:\Program Files\Mozilla Firefox\firefox.exe" -osint -url "%1"

to (where "MyContainer" is your container name you want new links to be opened in ):

"C:\Program Files\Mozilla Firefox\firefox.exe" ext+container:name=MyContainer&url="%1"

  • then all external links will launch in a "MyContainer" container.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .