Detach a tab in firefox (move tab to new window), Firefox 58

5

0

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.

MathProb

Posted 2018-02-06T08:03:43.960

Reputation: 153

Good question, but note I wouldn't expect any chrome:// URI to work in FF :-) – Sean Allred – 2018-02-07T00:00:13.730

@SeanAllred Thanks for your hint but I think it was quite usual before. See e.g. here: https://developer.mozilla.org/en-US/docs/Mozilla/Chrome_Registration

– MathProb – 2018-02-07T08:50:40.287

Correct me if I'm wrong, but I don't think that article is referring to chrome the browser. – Sean Allred – 2018-02-07T13:02:22.523

@SeanAllred but if I'm not wrong, neither does the command above? – MathProb – 2018-02-07T14:51:03.437

Well I'll be damned; I stand corrected. – Sean Allred – 2018-02-07T14:53:48.813

Answers

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

user873319

Posted 2018-02-06T08:03:43.960

Reputation:

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 – 2018-03-23T10:15:49.283

1On a Mac, use Cmd-Shift-1 instead of Ctrl-Shift-1 (doesn't do anything on a Mac). – HanSooloo – 2018-04-12T14:40:59.993

1This is great. Is your code on github/are you looking for feedback? – myesain – 2018-04-27T17:24:10.380