Files
tubestation/browser/devtools/framework/toolbox-window.xul
juliandescottes 5af8f706aa Bug 999568 - Bring devtools window to front on F12. r=pbrosset
Two keyboard shortcuts can toggle the devtools : F12 and CTRL+SHIFT+I/CMD+ALT+I.

Currently, with detached devtools, pressing a toggle key from the main window
closes the devtools window. Pressing a toggle key from the devtools window
itself has no effect.

The goal of this changeset is to :
- focus devtools window when pressing a toggle key in the main window
- close devtools window when pressing a toggle key in the devtools window

Modified toggleToolboxCommand in browser/devtools/framework/gDevTools.jsm to
destroy the toolbox only if it is "docked" (exists and the hostType is not
WINDOW).

Modified browser/devtools/framework/toolbox-window.xul and
browser/locales/en-US/chrome/browser/devtools/toolbox.dtd so that F12 and
CTRL+SHIFT+I/CMD+SHIFT+I also close the devtools window when used inside the
devtools window

Added mochitest browser_toolbox_toggle.js
2015-04-30 22:51:07 +02:00

46 lines
1.5 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!DOCTYPE window [
<!ENTITY % toolboxDTD SYSTEM "chrome://browser/locale/devtools/toolbox.dtd" >
%toolboxDTD;
]>
<?xml-stylesheet href="chrome://browser/skin/" type="text/css"?>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
id="devtools-toolbox-window"
macanimationtype="document"
fullscreenbutton="true"
windowtype="devtools:toolbox"
width="900" height="320"
persist="screenX screenY width height sizemode">
<commandset id="toolbox-commandset">
<command id="toolbox-cmd-close" oncommand="window.close();"/>
</commandset>
<keyset id="toolbox-keyset">
<key id="toolbox-key-close"
key="&closeCmd.key;"
command="toolbox-cmd-close"
modifiers="accel"/>
<key id="toolbox-key-toggle"
key="&toggleToolbox.key;"
command="toolbox-cmd-close"
#ifdef XP_MACOSX
modifiers="accel,alt"
#else
modifiers="accel,shift"
#endif
/>
<key id="toolbox-key-toggle-F12"
keycode="&toggleToolboxF12.keycode;"
keytext="&toggleToolboxF12.keytext;"
command="toolbox-cmd-close"/>
</keyset>
<iframe id="toolbox-iframe" flex="1" forceOwnRefreshDriver=""></iframe>
</window>