Opened 4 years ago

Closed 3 years ago

#17599 closed enhancement (fixed)

Please add keyboard shortcuts for New Identity and New Tor Circuit for this Site

Reported by: cypherpunks Owned by: tbb-team
Priority: Medium Milestone:
Component: Applications/Tor Browser Version:
Severity: Normal Keywords: tbb-usability, tbb-torbutton, TorBrowserTeam201605R
Cc: mcs Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

Please add keyboard shortcuts for New Identity and New Tor Circuit for this Site

Child Tickets

Change History (12)

comment:1 Changed 4 years ago by gk

Component: TorbuttonTor Browser
Keywords: tbb-usability tbb-torbutton added
Owner: set to tbb-team

comment:2 Changed 4 years ago by mcs

The New Identity part of this ticket is a duplicate of #17500. Should we have one ticket for each keyboard shortcut or just keep this one?

comment:3 Changed 4 years ago by gk

I think the latter assuming that both shortcuts seem like a reasonable idea and we provide both at the same time. Marking #17500 as a duplicate.

Last edited 4 years ago by gk (previous) (diff)

comment:4 Changed 4 years ago by cypherpunks

Here's what I propose:

New Identity: Ctrl/Cmd + Shift + U
New Tor Circuit for this Site: Ctrl/Cmd + Shift + L

According to this https://support.mozilla.org/en-US/kb/keyboard-shortcuts-perform-firefox-tasks-quickly, none of them are in use.

Thoughts?

comment:5 Changed 4 years ago by cypherpunks

Status: newneeds_revision

I've tried to implement this myself, but didn't get it to work.

torbutton.js:

var { Hotkey } = require("sdk/hotkeys");

var torbutton_hotkey_new_circuit = Hotkey({
  combo: "accel-shift-l",
  onPress: function() {
    torbutton_new_circuit();
  }
});
var torbutton_hotkey_new_identity = Hotkey({
  combo: "accel-shift-u",
  onPress: function() {
    torbutton_new_identity();
  }
});

What could be the problem? Is it some isolation in TBB that's not allowing a hotkey listener?

comment:6 Changed 4 years ago by docGreg

I support this feature. Please add this ASAP THANKS

comment:7 in reply to:  6 Changed 4 years ago by bugzilla

Replying to docGreg:
You support this feature when you allocate your resources (code, review, finances, etc.) to it. But now it is waiting for a review during 2 months as you see.

comment:8 in reply to:  5 Changed 4 years ago by mcs

Replying to cypherpunks:

I've tried to implement this myself, but didn't get it to work.

torbutton.js:

var { Hotkey } = require("sdk/hotkeys");
...

What could be the problem? Is it some isolation in TBB that's not allowing a hotkey listener?

Your code is written for an Add-on SDK based extension, but Torbutton is an old-style XUL extension. I have not tried this kind of thing lately, but adding an accesskey attribute to the correct menuitem should work. Some references:
https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Tutorial/Keyboard_Shortcuts
https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/accesskey

comment:9 Changed 4 years ago by mcs

Cc: mcs added

comment:10 Changed 3 years ago by cpwc

Here's a small patch that adds the hotkeys to the current TorBrowser 5.5.5. The "keyset" in torbutton.xul does the work. The change in popup.xul just makes it so the shortcuts are displayed next to the commands in the torbutton menu. Works for me. Thanks cypherpunks and mcs for leading the way.

--- chrome/content/popup.xul.orig       2000-01-01 00:00:00.000000000 -0700
+++ chrome/content/popup.xul    2016-05-23 00:00:00.000000000 -0700
@@ -19,11 +19,13 @@
         <menuitem id="torbutton-new-identity"
                   label="&torbutton.context_menu.new_identity;"
                   accesskey="&torbutton.context_menu.new_identity_key;"
+                  key="torbutton-new-identity-key"
                   insertafter="context-stop"
                   oncommand="torbutton_new_identity()"/>
         <menuitem id="torbutton-new-circuit"
                   label="&torbutton.context_menu.new_circuit;"
                   accesskey="&torbutton.context_menu.new_circuit_key;"
+                  key="torbutton-new-circuit-key"
                   insertafter="context-stop"
                   oncommand="torbutton_new_circuit()"/>
         <menuseparator/>
--- chrome/content/torbutton.xul.orig   2000-01-01 00:00:00.000000000 -0700
+++ chrome/content/torbutton.xul        2016-05-23 00:00:00.000000000 -0700
@@ -45,4 +45,11 @@
                         context="torbutton-context-menu" />
 <!--        <statusbarpanel context="clipmenu" class="statusbarpanel-iconic" id="plugins-status" tooltip="plugin-tooltip" onclick="torbutton_toggle_plugins();"/> -->
    </statusbar>
+
+   <!-- Global keyboard shortcuts for new identity and new circuit. -->
+   <keyset>
+        <key id="torbutton-new-identity-key" modifiers="accel shift" key="U" oncommand="torbutton_new_identity()"/>
+        <key id="torbutton-new-circuit-key" modifiers="accel shift" key="L" oncommand="torbutton_new_circuit()"/>
+   </keyset>
+
 </overlay>
Last edited 3 years ago by cpwc (previous) (diff)

comment:11 Changed 3 years ago by gk

Keywords: TorBrowserTeam201605R added
Status: needs_revisionneeds_review

Thanks, putting that onto our review radar.

comment:12 Changed 3 years ago by gk

Resolution: fixed
Status: needs_reviewclosed

Thanks, this makes it into 6.0: commit e546a3f158b6fc39c66e323eaa7b8463caef599c on master has the patch.

Note: See TracTickets for help on using tickets.