michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: "use strict"; michael@0: michael@0: const gcli = require("gcli/index"); michael@0: michael@0: exports.items = [{ michael@0: name: "inspect", michael@0: description: gcli.lookup("inspectDesc"), michael@0: manual: gcli.lookup("inspectManual"), michael@0: params: [ michael@0: { michael@0: name: "selector", michael@0: type: "node", michael@0: description: gcli.lookup("inspectNodeDesc"), michael@0: manual: gcli.lookup("inspectNodeManual") michael@0: } michael@0: ], michael@0: exec: function(args, context) { michael@0: let target = context.environment.target; michael@0: let gDevTools = require("resource:///modules/devtools/gDevTools.jsm").gDevTools; michael@0: michael@0: return gDevTools.showToolbox(target, "inspector").then(toolbox => { michael@0: toolbox.getCurrentPanel().selection.setNode(args.selector, "gcli"); michael@0: }); michael@0: } michael@0: }];