const { Panel } = require("dev/panel"); const { Tool } = require("dev/toolbox"); const { Class } = require("sdk/core/heritage"); var self = require('sdk/self'); const RDPPanel = Class({ extends: Panel, label: "RDP REPL", tooltip: "Simple RemoteDebuggingProtocol Panel", icon: self.data.url("./icon.png"), url: self.data.url("./panel.html"), // overload the setup method to get the debuggee message port setup: function({debuggee}) { this.debuggee = debuggee; }, dispose: function() { delete this.debuggee; }, onReady: function() { // when the panel is ready start the mesage port this.debuggee.start(); // and send it to the panel this.postMessage("RDP", [this.debuggee]); } }); // register the new Panel to the Developer Toolbox var rdpPanelTool = new Tool({ panels: { rdp: RDPPanel } });