add keyboard shortcut to duplicate (clone) tab

REOPENED
Unassigned

Status

()

defect
REOPENED
9 years ago
3 days ago

People

(Reporter: fryn, Unassigned)

Tracking

Trunk
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 obsolete attachment)

(Reporter)

Description

9 years ago
Forked from bug 455722 (see bug 455722 comment #35 and bug 455722 comment #35) to avoid bikeshedding, since that bug's patch already got ui-review+.

Klaas Heidstra suggested ctrl+shift+c (shift+cmd+c), which patch v1 uses. I presume that 'c' comes from the word 'clone'.

I considered opt+cmd+t, since it's an alternate way to open a new tab, but it doesn't translate well to Windows and Linux.

(patch v1 also fixes a minor error produced when attempting to undo a closed tab when no browser windows are open.)
Attachment #472860 - Flags: ui-review?(faaborg)
Attachment #472860 - Flags: review?(dao)
Attachment #472860 - Flags: ui-review?(faaborg) → ui-review+

Comment 1

9 years ago
> Klaas Heidstra suggested ctrl+shift+c (shift+cmd+c), which patch v1 uses. I
> presume that 'c' comes from the word 'clone'.

Or 'copy'. Ctrl+c is the standard shortcut for copy, thus adding a shift we have ctrl+shift+c to copy/clone the tab. Has a logic to it.

Updated

9 years ago
No longer depends on: 455722
Comment on attachment 472860 [details] [diff] [review]
patch v1 (ctrl+shift+c / shift+cmd+c)

>-    <command id="History:UndoCloseTab" oncommand="undoCloseTab();"/>
>+    <command id="History:UndoCloseTab" oncommand="if (gBrowser) undoCloseTab();"/>
>     <command id="History:UndoCloseWindow" oncommand="undoCloseWindow();"/>
>+
>+    <command id="cmd_duplicateTab"
>+             oncommand="if (gBrowser) duplicateTabIn(gBrowser.selectedTab, 'tab');"/>

Why if (gBrowser)?

This doesn't actually display the shortcut anywhere, so it's pretty much undiscoverable...
(Reporter)

Comment 3

9 years ago
(In reply to comment #2)
> Why if (gBrowser)?

On OS X, these shortcuts can be triggered even when no browser window is open.

> This doesn't actually display the shortcut anywhere, so it's pretty much
> undiscoverable...

Sadly true.
(In reply to comment #3)
> (In reply to comment #2)
> > Why if (gBrowser)?
> 
> On OS X, these shortcuts can be triggered even when no browser window is open.

Seems like we should define the <key> only in real browser windows.
(Reporter)

Comment 5

9 years ago
(In reply to comment #4)
> Seems like we should define the <key> only in real browser windows.

'Undo close tab' and 'Duplicate tab' would then be the only <key>s outside of browser-sets.inc.

The alternative would be to put the gBrowser check inside the function, but that seems more questionable.
Assignee: fryn → nobody
(In reply to comment #5)
> (In reply to comment #4)
> > Seems like we should define the <key> only in real browser windows.
> 
> 'Undo close tab' and 'Duplicate tab' would then be the only <key>s outside of
> browser-sets.inc.

They can stay there, just need to be set conditionally, using e.g. "#ifdef FULL_BROWSER_WINDOW", which browser.xul would define.
Attachment #472860 - Flags: review?(dao)
(Reporter)

Comment 7

9 years ago
> This doesn't actually display the shortcut anywhere, so it's pretty much
> undiscoverable...

Unassigned myself, since I don't think it makes sense to include this shortcut, if we're not going to display it anywhere. I have no objections to a WONTFIX.
Status: ASSIGNED → NEW
(Reporter)

Comment 8

9 years ago
WONTFIX for above reasons.
Status: NEW → RESOLVED
Last Resolved: 9 years ago
Depends on: 455722
Resolution: --- → WONTFIX
(Reporter)

Updated

9 years ago
Attachment #472860 - Attachment is obsolete: true
Overloading the "C" key seems odd, but I could see Control/Command-T (plus modifier) being used... That said, this still seems like a uncommon action best left to an addon.

Comment 10

8 years ago
Uncommon action in general or in Firefox? See Bug 455722, duplicating a tab in Firefox is a non-discoverable feature, while Chrome, Opera and IE all have the action available in tab context menu.
now that https://bugzilla.mozilla.org/show_bug.cgi?id=455722 is fixed - reopening this.
Status: RESOLVED → REOPENED
Resolution: WONTFIX → ---
You need to log in before you can comment on or make changes to this bug.