panel.js (755B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 5 "use strict"; 6 7 const { 8 Inspector, 9 } = require("resource://devtools/client/inspector/inspector.js"); 10 11 class InspectorPanel { 12 constructor(iframeWindow, toolbox, commands) { 13 this.#inspector = new Inspector(toolbox, commands, iframeWindow); 14 } 15 16 #inspector; 17 18 /** 19 * Initialize the inspector 20 * 21 * @param {object} options: see Inspector.init 22 * @returns {Inspector} 23 */ 24 open(options = {}) { 25 return this.#inspector.init(options); 26 } 27 28 destroy() { 29 this.#inspector.destroy(); 30 } 31 } 32 exports.InspectorPanel = InspectorPanel;