/* 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/. */
"use strict";
/** * This module defines the sorted list of menuitems inserted into the * "Browser Tools" menu. * It also defines the key shortcuts that relates to them. * * Various fields are necessary for historical compatiblity with XUL/addons: * - id: * used as <xul:menuitem> id attribute * - l10nKey: * prefix used to locale localization strings from menus.properties * - oncommand: * function called when the menu item or key shortcut are fired * - keyId: * Identifier used in devtools/client/devtools-startup.js * Helps figuring out the DOM id for the related <xul:key> * in order to have the key text displayed in menus. * - checkbox: * If true, the menuitem is prefixed by a checkbox and runtime code can * toggle it.
*/
// The eyedropper might be used without a toolbox, so it should use a // dedicated commands instance. // See Bug 1701004. const commands = await CommandsFactory.forTab(
window.gBrowser.selectedTab
);
await commands.targetCommand.startListening();
// If RDM is active, disable touch simulation events if they're enabled. // Similarly, enable them when the color picker is done picking. if (ResponsiveUIManager.isActiveForTab(target.localTab)) { const ui = ResponsiveUIManager.getResponsiveUIForTab(target.localTab);
await ui.responsiveFront.setElementPickerState( true,
PICKER_TYPES.EYEDROPPER
);
// Destroy the dedicated commands instance when the color picking is // finished.
inspectorFront.once("color-picked", () => commands.destroy());
inspectorFront.once("color-pick-canceled", () => commands.destroy());
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.