Open Bug 1269509 Opened 8 years ago Updated 2 years ago

Shortcut to open DOM Inspector (Ctrl+Shift+W) conflicts with the one for closing Firefox

Categories

(DevTools :: DOM, defect, P2)

defect

Tracking

(firefox49 affected)

Tracking Status
firefox49 --- affected

People

(Reporter: sebo, Unassigned)

References

(Blocks 1 open bug)

Details

The DOM Inspector currently uses Ctrl+Shift+W as shortcut, which is already used to close the application.

Instead Ctrl+Shift+D could be used, which doesn't seem to have another action assigned at the moment.

Sebastian
>>>   My Info:   Win7_64, Nightly 49, 32bit, ID 20160517030211
Suggested shortcut Ctrl+Shift+D is currently used for bookmarking all tabs AND for switching docking mode in devtools and couldn't be used for anything else.
Summary: Shortcut to open DOM Inspector conflicts with the one for closing Firefox → Shortcut to open DOM Inspector (Ctrl+Shift+W) conflicts with the one for closing Firefox
(In reply to arni2033 from comment #1)
> >>>   My Info:   Win7_64, Nightly 49, 32bit, ID 20160517030211
> Suggested shortcut Ctrl+Shift+D is currently used for bookmarking all tabs
> AND for switching docking mode in devtools and couldn't be used for anything
> else.

You're right. I don't know how I could miss that. So, how about Ctrl+Alt+D then? That doesn't seem to be assigned to anything, AFAICS.

Sebastian
Assignee: nobody → sole
Some background info I've collected to work on this bug (thanks Honza!)

* devtools/client/definitions.js

This file defines all Toolbox panels (i.e. the 'tools') in the Tools variable

Every definition collects some meta data about a panel, e.g. its ID, name, icon as well as 'accesskey', 'commandkey' and modifiers (e.g. shift, alt...) that must be pressed at the same time to activate the panel.

Right now it's defined as W for the commandkey (to activate it) plus modifiers = 'accel,shift' which is translated to CTRL+SHIFT when not running in Mac OS (Darwin). This ends up being CTRL+SHIFT+W, which effectively closes the tab, and it's not the result we want.

The DOM inspector tool (or DOM panel) is defined as `Tools.dom`.

The values of both "dom.accesskey" and "dom.commandkey" are obtained with the l10n() function, which reads them from the startup.properties file:

* devtools/client/locales/en-US/startup.properties

  # LOCALIZATION NOTE (dom.commandkey, dom.accesskey)
  # Used for the menuitem in the tool menu
  dom.commandkey=W
  dom.accesskey=D

(this is to make the shortcuts localizable)

* devtools/client/framework/browser-menus.js is where the meta data is actually used. The function `createToolMenuElements` gets a tool definition and uses 'key' and 'accesskey':

  if `toolDefinition.key` exists then => createKey

... and createKey (in the same file) creates the xul:key element (for the shortcut)



So we want to use some other combination of commandkey + modifiers that

a) does not close the tab or have other unexpected side effect
b) is not already in use

Since there isn't a centralised place to look at shortcut definitions, a temporary option is to keep track of the created keys in createKey and emit a warning if we see a duplicate (and also remove this check once a better shortcut key is found!).
Some more investigations after:

- This panel is not the normal Inspector that is enabled by default, but the "DOM inspector" that has to be manually enabled in the settings
- Suggested shortcuts using D instead of W are not workable:
   - Accel+Alt+D (i.e. ⌘+Alt+D on Mac) toggles the Mac OS dock
   - Accel+Shift+D (⌘+Shift+D on Mac) offers to bookmark all tabs, as mentioned above
Product: Firefox → DevTools

I have certainly not worked on this for a while so I'm going to deassign myself from the bug

Assignee: spenades → nobody
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.