This site will have limited functionality while we undergo maintenance to improve your experience. If an article doesn't solve your issue and you want to ask a question, we have our support community waiting to help you at @FirefoxSupport on Twitter and/r/firefox on Reddit.

Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

Switch between Tabs - Recent Order + Tab Order - Best of Two Worlds

  • 3 replies
  • 1 has this problem
  • 8 views
  • Last reply by Cartucho

more options

When switching tabs, Firefox allows you two behaviours: Recent Order or Tab Order but you have to choose between them. This is a trick to have THE TWO BEHAVIOURS TOGETHER Catch: AutoHotkey is required.

In Firefox Options/Preferences -> General -> Tabs" mark enable recent order (ticked) Then compile the next script in Autohotkey and keep it running.


  1. if WinActive("ahk_exe firefox.exe")

^Q::Send, ^{TAB} ^Tab::Send, ^{PGDN} +^Tab::Send, ^{PGUP}

  1. if

Now with Ctrl+Tab and Ctrl+Shift+Tab you move right and left between Tabs and with Ctrl+Q you move to last viewed Tab. I choose Q because is next to Tab but you can change it in the second line of the script. Cheers!

When switching tabs, Firefox allows you two behaviours: '''Recent Order''' or '''Tab Order''' but you have to choose between them. This is a trick to have '''THE TWO BEHAVIOURS TOGETHER''' Catch: AutoHotkey is required. In Firefox Options/Preferences -> General -> Tabs" mark enable recent order (ticked) Then compile the next script in Autohotkey and keep it running. ----------------------------------------------- #if WinActive("ahk_exe firefox.exe") ^Q::Send, ^{TAB} ^Tab::Send, ^{PGDN} +^Tab::Send, ^{PGUP} #if ----------------------------------------------- Now with '''Ctrl+Tab''' and '''Ctrl+Shift+Tab''' you move right and left between Tabs and with '''Ctrl+Q''' you move to last viewed Tab. I choose Q because is next to Tab but you can change it in the second line of the script. Cheers!

All Replies (3)

more options

This forum change some characters of the script... (don't work if copy like that) where says "1." change for the simbol "#"

Maybe some moderator can edit it. Thanks!

more options

If you put a blank space at the beginning of each line, or but <pre> before and </pre> after your code, the forum won't mess with it.

Also, there are add-ons for this. I prefer sequential access as my default, so my add-on allows assigning a keyboard shortcut to switch to the last active tab. It also has drop-down lists, if that would be of interest.

https://addons.mozilla.org/firefox/addon/switch-to-previous-active-tab/

more options

jscher2000 said

If you put a blank space at the beginning of each line, or but <pre> before and </pre> after your code, the forum won't mess with it. Also, there are add-ons for this. I prefer sequential access as my default, so my add-on allows assigning a keyboard shortcut to switch to the last active tab. It also has drop-down lists, if that would be of interest. https://addons.mozilla.org/firefox/addon/switch-to-previous-active-tab/

Thanks! I did not know that extension... I think what is better that way what depend of a external program.

About forum messing with code, thanks for the tip but I can't edit my posts... maybe for next time.