Closed
Bug 891556
Opened 11 years ago
Closed 11 years ago
Add Ctrl-Shift-C (Cmd-Opt-C) shortcut to toggle highlighting
Categories
(DevTools :: Inspector, defect)
DevTools
Inspector
Tracking
(Not tracked)
RESOLVED
FIXED
Firefox 25
People
(Reporter: harth, Assigned: bgrins)
References
(Blocks 1 open bug)
Details
(Whiteboard: [landed-in-fxteam])
Attachments
(1 file, 4 obsolete files)
14.60 KB,
patch
|
Details | Diff | Splinter Review |
Currently we don't have a shortcut to toggle the highlighter. We need this. Chrome uses Ctrl-Shift-C (Cmd-Opt-C), and it's available in Mac/Win at least. If the toolbox is open, this will switch to the Inspector tab and start the highlighter. If the toolbox is closed, it will open the devtools window with the Inspector tab selected and start highlighting. If the inspector tab is already open, this will just start highlighting. And if the highlighter happens to be on, this will stop highlighting.
Updated•11 years ago
|
Blocks: devtools-shortcuts
Assignee | ||
Updated•11 years ago
|
Assignee: nobody → bgrinstead
Assignee | ||
Comment 2•11 years ago
|
||
Flags: needinfo?(fayearthur)
Updated•11 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Comment 3•11 years ago
|
||
Version that works, except for when devtools is undocked and you are focused on the web
Attachment #783905 -
Attachment is obsolete: true
Attachment #784059 -
Flags: feedback?
Assignee | ||
Comment 4•11 years ago
|
||
This patch implements the cmd+alt+c keyboard shortcut for toggling highlighting, and fixes another issue that happened when devtools were undocked *and* focused - keyboard shortcuts would not fire in the same way. This is because _addKeysToWindow (toolbox.js) was actually running different logic than selectToolCommand (gDevTools.jsm). Rather than trying to figure out a way to pass gBrowser to selectToolCommand from toolbox.js (which is not possible AFAIK), I implemented a fireCustomKey instance method on the toolbox. This way at least some of the logic can be shared between gDevTools and toolbox. It will take a while to work out how to properly test this, so this patch is still a WIP.
Attachment #784059 -
Attachment is obsolete: true
Attachment #784059 -
Flags: feedback?
Flags: needinfo?(fayearthur)
Assignee | ||
Comment 5•11 years ago
|
||
Adds a basic keybinding test for the panels. The behavior is such that on inspector, pressing ctrl+shift+c/cmd+alt+c will always switch to inspector tab and toggle highlighter. For the other panels, they will continue to switch to their tab if not already selected, or close devtools otherwise. The behavior for other tabs is different when devtools in undocked, since it will never close the window. For inspector, the behavior is the same when docked and undocked. Had to work around a situation where the keyboard shortcut for inspector did not work when the devtools window was focused (_addKeysToWindow had to be modified to fix this).
Attachment #784535 -
Attachment is obsolete: true
Attachment #785086 -
Flags: review?(jwalker)
Comment 6•11 years ago
|
||
Comment on attachment 785086 [details] [diff] [review] bug-891556-4.patch Review of attachment 785086 [details] [diff] [review]: ----------------------------------------------------------------- ::: browser/devtools/framework/gDevTools.jsm @@ +349,3 @@ > > if (toolbox && toolbox.currentToolId == toolId) { > + let customKeyHandled = toolbox.fireCustomKey(toolId); As discussed, we can probably find a more obvious solution than this, perhaps using a property to indicate how the tool wants to handle toggling. ::: browser/devtools/framework/toolbox.js @@ +285,5 @@ > + > + if (activeToolDefinition.onkey && this.currentToolId === toolId) { > + activeToolDefinition.onkey(this.getCurrentPanel()); > + return true; > + } I know that undefined==false, but I still think it makes sense to 'return false;' here in case anyone assumes a boolean.
Attachment #785086 -
Flags: review?(jwalker) → review+
Assignee | ||
Comment 7•11 years ago
|
||
Fixes minor issues from previous patch
Attachment #785086 -
Attachment is obsolete: true
Comment 9•11 years ago
|
||
https://tbpl.mozilla.org/?tree=Fx-Team&rev=79edca22de3f https://hg.mozilla.org/integration/fx-team/rev/9e0f2aef72e3
Flags: needinfo?(jwalker)
Whiteboard: [landed-in-fxteam]
Comment 10•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/9e0f2aef72e3
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 25
Comment 11•11 years ago
|
||
FYI this new shortcut conflicts with Firebug.[1] > Currently we don't have a shortcut to toggle the highlighter. Actually you already had Ctrl+Shift+I for it since you introduced the inspector. Sebastian [1] http://code.google.com/p/fbug/issues/detail?id=6957
Comment 12•11 years ago
|
||
Any tips, how Firebug can simply override the default Ctrl+Shift+C shortcut? Honza
Comment 13•10 years ago
|
||
Any thoughts on this access key changed? http://hg.mozilla.org/mozilla-central/diff/9e0f2aef72e3/browser/locales/en-US/chrome/browser/devtools/inspector.properties http://transvision.mozfr.org/string/?entity=browser/chrome/browser/devtools/inspector.properties:inspector.commandkey&repo=central
Updated•6 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•