11

Is there a shortcut key to switch back and forth between two tabs in Firefox?

For example, you can press CTRL + 1 to select the first tab, CTRL + 2 to select the second. What I want to do is switch between the current tab and the last selected tab. TV remotes have a similar previous or back button that does the same thing. If you only press this one button it will switching solely between two channels each time it is pressed. I see this is called a "last" button on TV remotes.

UPDATE:
I know you can move a tab to be right next to each other as tab 1 and tab 2 and then use ctrl + 1 and ctrl + 2 but I'm talking about a switch shortcut.

I'm using Mac.

5
  • It may be different based on Operating System. Could you add which one you are using?
    – AMR
    Commented Aug 31, 2015 at 1:10
  • I'm on Macintosh Commented Aug 31, 2015 at 1:19
  • I made an answer, then reread the question and understood that the posted answer is correct? If so, please mark it as the answer to eliminate confusion. An alternate for switching between tabs would be Ctrl+ Page Down if that's the functionality you're looking for.
    – DrZoo
    Commented Aug 31, 2015 at 3:30
  • It's acceptable but it's not the exact answer to the question. I left it unchecked because there may be a keyboard shortcut that does what I'm looking for. The solution you posted pulls any open windows apart into a dual view on you can see the content of both windows. It's pretty neat and it would also be acceptable but it's not a toggle switch. Commented Aug 31, 2015 at 6:32
  • In newer versions of Firefox, to go to first tab, press Alt+1, and the second tab: Alt-2, and so on.
    – Flimm
    Commented Feb 8 at 22:47

5 Answers 5

8

In order to switch between the two last selected tabs (and to enable Windows like Alt + Tab task switching for Firefox Tabs) you need to

  1. open about:config and
  2. change browser.ctrlTab.previews to true

and you're done. Now you can switch between the last two selected tabs by quickly pressing Ctrl + Tab. If you press Tab repeatedly – or keep Ctrl pressed – you can switch to other tabs too. If you want to cycle the previews in reverse, just throw Shift in there as well.

4
  • Thank you. Is the keyboard shortcut hard coded? For example, could I change it to ALT + Tab? Commented Aug 31, 2015 at 10:58
  • Judging by the preference's name you can't change it. There used to be some kind of extension called _Keyconfig _ that allowed changing/defining shortcuts but I'm not sure if it's still working. So I guess you can't.
    – JC2k8
    Commented Aug 31, 2015 at 11:04
  • 1
    This seems to be cycling through the tabs on my machine. In superuser.com/questions/290704/… it says that you can use ctrl + shift + tab to go backward.
    – Att Righ
    Commented Dec 9, 2021 at 11:40
  • The fastest way I know when your grail is in a haystack of tabs is to search for the tab by typing % + space in the address bar (Ctrl+L to remain in the tab or after a Ctrl+ T for a new tab). Whatever you type next will be used to try to identify a tab
    – chaami
    Commented Oct 14, 2023 at 22:01
5

This should help you out Firefox Keyboard Shortcuts

As I said in my comment it can depend on the operating system you are using for Mac it is command + option + to go backwards and command + option + to go forward in the stack.

5
  • 1
    I do not want to go back and forth in history. I want to switch between two tabs. Going back and forth causes forms to be emptied, pages to reload and other problems. Commented Aug 31, 2015 at 1:23
  • 1
    Sorry, I think I misunderstood your original question... you basically want a last button.
    – AMR
    Commented Aug 31, 2015 at 1:23
  • From what I am testing it has nothing to do with history, it just pages between the tabs, and any filled in fields are not changing.
    – AMR
    Commented Aug 31, 2015 at 1:25
  • 1
    You're right! It is switching between the tabs next to each other! This is good enough for me. Commented Aug 31, 2015 at 1:27
  • Command + Arrow is back and forward in history. Adding the option lets you navigate through the tabs instead. Glad that works.
    – AMR
    Commented Aug 31, 2015 at 1:30
5

In the latest version of firefox you need to do:

  1. open about:config and
  2. search and change browser.ctrlTab.sortByRecentlyUsed to true

and you're done. Now you can switch between the last two selected tabs by quickly pressing Ctrl + Tab. If you press Tab repeatedly – or keep Ctrl pressed – you can switch to other tabs too.

1
  • When you have 100+ tabs open you probably want the option specified in this answer, rather than just simply cycling forward and backward.
    – philbert
    Commented Apr 3 at 16:09
1
  • Ctrl+Page Up
  • Ctrl+Page Down
1
  • Use Control even on macOS. Don't press Command instead.
    – Flimm
    Commented Feb 8 at 22:53
1

Check out the default behaviour of

Ctrl+Tab

and

Ctrl+Shift+Tab

These cycle through the open tabs in order, so if you're working on two tabs you can use these shortcuts to shift between them easily.

1
  • 1
    Use Control even on macOS, don't press Command instead.
    – Flimm
    Commented Feb 8 at 22:53

You must log in to answer this question.

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