5

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?

This question was answered for older versions of FF (see shortcut key to detach a tab in firefox (move tab to new window) ) The solution used Keyconfig, which is no longer supported by FF 58. There is a somewhat similar tool, called Shortkeys.

However, the code proposed in the solution to the earlier question

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

doesn't work if one uses the option to "Run JavaScript" in the settings of Shortkeys.

Is there any idea how to fix this and/or how to use the great functionality of detaching tabs with shortcuts from FF 58 onwards?

Of course I did check the documentation but couldn't find the right shortcut.

  • Good question, but note I wouldn't expect any chrome:// URI to work in FF :-) – Sean Allred Feb 7 '18 at 0:00
  • @SeanAllred Thanks for your hint but I think it was quite usual before. See e.g. here: developer.mozilla.org/en-US/docs/Mozilla/Chrome_Registration – MathProb Feb 7 '18 at 8:50
  • Correct me if I'm wrong, but I don't think that article is referring to chrome the browser. – Sean Allred Feb 7 '18 at 13:02
  • @SeanAllred but if I'm not wrong, neither does the command above? – MathProb Feb 7 '18 at 14:51
  • Well I'll be damned; I stand corrected. – Sean Allred Feb 7 '18 at 14:53
3

Edit 2:: I've uploaded a new signed extension that moves the active tab to a new window on Ctrl+Shift+1: https://drive.google.com/file/d/1bUVSWvgRXPPmtjYl5am-dn9a6JEEzzGO/view?usp=sharing. The shortcut isn't intuitive, but without knowing the platform Firefox is running on, I have to plan for compatibility.

Sorry about the first edit; I uploaded the wrong extension by accident. The one in the link above should meet the criteria from the question.

Edit: A signed version of the extension is here: https://drive.google.com/file/d/19okZRGCQa5pGH08HD2ml9D2TQcStnk0Q/view?usp=sharing

Old Answer:

I made a Firefox WebExtension that moves the active tab to a new window on Ctrl+Shift+0. It's unsigned, but you can easily verify for yourself that the 46 lines of code aren't malicious.

You can try it out in Nightly by setting xpinstall.signatures.required to false and clicking [Install Add-on From File...] in the gear menu in about:addons. I think unsigned extensions can still be temporarily installed on release builds of Firefox through [Load Temporary Add-on] in about:debugging.

You are free to modify the extension source to suit your needs or ask me to do so.

https://drive.google.com/file/d/1zRmAy-EHB4EspY_d9WVbXpddBJA9l48W/view?usp=sharing

| improve this answer | |
  • Thanks for the signed version (and sorry for my slow reply). It seems that one cannot really detach a tab from an active browser window. It works fine to move tabs around (i.e. I have two open windows and can move the tabs from one to another), but it seems that creating a new windwo with the selected tab doesn't work. Do you have any thoughts how that could work? Thanks again for your help and your effort! – MathProb Mar 23 '18 at 10:15
  • 1
    On a Mac, use Cmd-Shift-1 instead of Ctrl-Shift-1 (doesn't do anything on a Mac). – HanSooloo Apr 12 '18 at 14:40
  • 1
    This is great. Is your code on github/are you looking for feedback? – myesain Apr 27 '18 at 17:24

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.