Skip to main content
fix(rectifications): on Eduardo Trápani and Didier replies
Source Link

Any methods, where user don't need to click manually to specific button are welcome. For example, it would be nice get expected behavior via any free:

  1. Shortcut
  2. Underline access key shortcuts of Firefox menu or context menu

    Extension or script (for example, written in AutoHotkey), so that I can close all tabs via:

    1. Shortcut
    2. And/or underline access key shortcuts of Firefox menu or context menu
  3. Any CLI tools

    CLI commands

I don't need to automatically add random tabs to groups. Groups must contain a specific set of tabs; adding, editing and removing tabs of groups must be solely manually in my case.

3.5. Stay in current Firefox profile

I can programmatically close Firefox → then open new Firefox instance with specific tabs as this:

firefox -P "SashaChernykh" --new-tab -url https://KiraGoddess.com --new-tab -url https://KiraGreatest.com

But in this case pinned tabs from previous session will be preserve in new instance.

I can't find, how I can solve this problem. Yes, I can open new tabs use new Firefox profile, but, possibly, it a not good idea. I'll have to configure and update settings, extensions, bookmarks and so on for each profile. Its additional work, whereas one profile is enough for me.

It would be nice close all tabs, stay in current Firefox profile.

Any methods, where user don't need to click manually to specific button are welcome. For example, it would be nice get expected behavior via:

  1. Shortcut
  2. Underline access key shortcuts of Firefox menu or context menu
  3. Any CLI tools

I don't need to automatically add random tabs to groups. Groups must contain a specific set of tabs; adding, editing and removing tabs of groups must be solely manually in my case.

Any methods, where user don't need to click manually to specific button are welcome. For example, it would be nice get expected behavior via any free:

  1. Extension or script (for example, written in AutoHotkey), so that I can close all tabs via:

    1. Shortcut
    2. And/or underline access key shortcuts of Firefox menu or context menu
  2. CLI commands

I don't need to automatically add random tabs to groups. Groups must contain a specific set of tabs; adding, editing and removing tabs of groups must be solely manually in my case.

3.5. Stay in current Firefox profile

I can programmatically close Firefox → then open new Firefox instance with specific tabs as this:

firefox -P "SashaChernykh" --new-tab -url https://KiraGoddess.com --new-tab -url https://KiraGreatest.com

But in this case pinned tabs from previous session will be preserve in new instance.

I can't find, how I can solve this problem. Yes, I can open new tabs use new Firefox profile, but, possibly, it a not good idea. I'll have to configure and update settings, extensions, bookmarks and so on for each profile. Its additional work, whereas one profile is enough for me.

It would be nice close all tabs, stay in current Firefox profile.

Source Link

Programmatically close all tabs in Firefox Quantum

1. Summary

I can't find, how I can close all tabs in Firefox Quantum without any manual mouse clicks.


2. Details

(Details for preventing XY Problem)

I am working on several projects. I need always opened tabs for different projects (different tabs for different projects).

When I start working on one of my projects, I want automatically and quickly switch between projects: I press hotkey → all current browser tabs close → project-specific tabs open.


3. Requirements

3.1. Types of tabs

These types of tabs also must be closed:

  1. Pinned
  2. Current; browser.tabs.closeWindowWithLastTab key value is false for me

3.2. Methods

Any methods, where user don't need to click manually to specific button are welcome. For example, it would be nice get expected behavior via:

  1. Shortcut
  2. Underline access key shortcuts of Firefox menu or context menu
  3. Any CLI tools

But click to specific buttons in Firefox toolbars is not expected. Reason — I don't find, how I can write the script, that can automatically clicks to specific button (but if you know, how do it, please, make an answer).

3.3. No clicking to specific coordinates

Yes, for example, I can install Close All Tabs Button extension → get x and y coordinates of this extension button → set via AutoHotkey automatically clicking to these coordinates.

But this is not better solution. I can:

  1. Add, remove and move buttons in Firefox toolbar.
  2. Resize Firefox windows.

Coordinates will be shifted in these cases.

3.4. No auto-adding to groups

I tried some Firefox tabs organizers/tabs managers. They have a common non-expected behavior.

I created tab groups of my projects → I added required URLs for each group → I opened any new tabs in browser → this tabs automatically added to one of groups.

I don't need to automatically add random tabs to groups. Groups must contain a specific set of tabs; adding, editing and removing tabs of groups must be solely manually in my case.


4. Not helped

4.1. Close all tabs extensions

4.1.1. Doesn't close pinned and current tabs

See 3.1 item, why it not expected.

  1. Close All Tabs

4.1.2. No hotkeys and/or menu items

See 3.2 item, why it not expected.

  1. Close All Tabs Button

4.1.3. Both

Both problems: Doesn't close pinned and current tabs and No hotkeys and/or menu items.

  1. Tab Closer
  2. Close All Tabs Button

4.2. Tabs organizers

4.2.1. Non-free

  1. Toast
  2. Workona

4.2.2. Auto-adding to groups

I described this problem in 3.4 item.

  1. Simple Tab Groups
  2. Tab Workspaces
  3. Tab Manager
  4. Power Tabs
  5. Panorama Tab Groups
  6. Tab Manager Plus for Firefox
  7. Conex
  8. Tab Group Switch

4.2.3. No hotkeys

Use these extensions, I can close all previous tabs and open new; but manual mouse clicks required. See 3.2 item for details.

  1. Group Speed Dial
  2. Tab Stash