14

In FF, I can move a tab to a new window by either dragging the tab out of the browser, or right clicking the "move to New window" option from the context menu. is there a shortcut key to move the current tab to a new window without dragging or using the context menu, or a way to set one up?

Often, I like to look at 2 tabs side by side, so I drag one out, then hit WINDOWS KEY+ to put the detached tab on the right, then ALT+TAB to tab back to the main window, then WINDOWS KEY+ to put the main window on the left. It would be great if I could do the whole process on the keyboard.

I checked this documentation and did not find any shortcut key for detaching a tab:

8
+50

Here's how to create your own keyboard shortcut to Detach a Firefox Tab to a New Window:

  1. Install the Keyconfig addon

  2. Open the Keyconfig Preferences by pressing Ctrl+Shift+F12 (On Mac it may be ⌘ Cmd+Shift+F12)

  3. Click Add a new key at the bottom left of the keyconfig window.

  4. Replace the contents of the Name field with the name of this command:

    Detach Tab to New Window
    
  5. Paste the following code into the /* CODE */ field:

    window.openDialog("chrome://browser/content/browser.xul","_blank","chrome,dialog=no,all",gBrowser.mCurrentTab);
    
  6. Click OK.

  7. Your new command will be marked as <Disabled> This means you need to set a keyboard shortcut for this command. Make sure your command is selected from the list of commands. Click inside the field at the bottom left of the window. It will highlight the contents and whatever keys you hit next will be entered inside that box. For example, you might use Ctrl+Alt+N. Or if you're a fan of Vim you might use Shift+Y.

  8. Click Apply and then click Close to close the keyconfig window. Test your keyboard shortcut by loading a window with at least 2 tabs and then use your new keyboard shortcut. The current tab should detach itself and form a new window.

3

With Vimium-FF, it can be done by pressing W, i.e. shift + w.

3

I like to use this shortcut sequence, which does what you want:

Ctrl-L # Focus URL
Ctrl-C # Copy it
Ctrl-W # Close current tab
Ctrl-N # Open new window
Ctrl-V # Paste 
Enter  # Open URL

Obviously it has side effects:

  1. Your buffer is overridden
  2. The page is reloaded (don't do it if you already put input on that page)
  3. It won't work if the current page captures Ctrl-L (like the StackExchange post editor, which has it mapped to "Insert Hyperlink" :-D)

But it doesn't require addons or code.

  • What does "capture" mean in this context? Does it refer to something specific to browsers? Or does it just mean that Ctrl-L is ignored when the cursor is focused on an edit field, or some other element contained within the page? – Nicholas Cousar Oct 9 at 21:05
  • Apparently a website may override shortcuts such as Ctrl-L. The StackExchange editor (the one you get when you answer a question) has Ctrl-L bound to "insert hyperlink", so you won't be able to focus the URL on that website or in that context. – exic Oct 11 at 4:10
2

In addition to @Nic's answer, use the following code to also close the detached tab from the original window:

window.openDialog("chrome://browser/content/browser.xul","_blank","chrome,dialog=no,all",gBrowser.mCurrentTab);
window.open('','_gBrowser.mCurrentTab').close();
0

For a list of all keyboard shortcuts in FireFox, visit this website. For information on tab shortcuts, scroll down about halfway. I believe the one you are looking for is Insert or Shift+Insert.

  • 2
    I checked there first but didn't see anything. I should add that to the question. Insert and shift+insert don't do anything for me. – chiliNUT Feb 24 '15 at 4:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.