/* See license.txt for terms of usage */

"use strict";

const { Cu } = require("chrome");

try {
  // New devtools modules path. See also:
  // * https://wiki.mozilla.org/DevTools/Hacking
  // * https://github.com/jryans/devtools-migrate/blob/master/README.md
  // * https://developer.mozilla.org/en-US/docs/Tools/Contributing
  exports.devtools = Cu.import("resource://gre/modules/devtools/shared/Loader.jsm", {}).devtools;
  exports.makeInfallible = exports.devtools["require"]("devtools/shared/DevToolsUtils.js").makeInfallible;
  exports.gDevTools = Cu.import("resource:///modules/devtools/client/framework/gDevTools.jsm").gDevTools;

} catch(e) {
  exports.devtools = Cu.import("resource://gre/modules/devtools/Loader.jsm", {}).devtools;
  exports.makeInfallible = exports.devtools["require"]("devtools/toolkit/DevToolsUtils.js").makeInfallible;
  exports.gDevTools = Cu.import("resource:///modules/devtools/gDevTools.jsm", {}).gDevTools;
}

@@ -425,38 +425,37 @@
 ;%0A  exports.
-makeInfallible
+DevToolsUtils
  = exports.d
@@ -495,37 +495,84 @@
 ed/DevToolsUtils
-.js%22)
+%22);%0A  exports.makeInfallible = exports.DevToolsUtils
 .makeInfallible;
@@ -678,16 +678,406 @@
 vTools;%0A
+  exports.EventEmitter = exports.devtools%5B%22require%22%5D(%22devtools/shared/event-emitter%22);%0A  exports.ToolSidebar = exports.devtools%5B%22require%22%5D(%22devtools/client/framework/sidebar%22).ToolSidebar;%0A  exports.CssLogic = exports.devtools%5B%22require%22%5D(%22devtools/shared/styleinspector/css-logic%22).CssLogic;%0A  exports.Widgets = exports.devtools.require(%22devtools/client/webconsole/console-output%22).Widgets;
 %0A%7D catch
@@ -1179,38 +1179,37 @@
 ;%0A  exports.
-makeInfallible
+DevToolsUtils
  = exports.d
@@ -1262,13 +1262,60 @@
 tils
-.js%22)
+%22);%0A  exports.makeInfallible = exports.DevToolsUtils
 .mak
@@ -1420,10 +1420,381 @@
 vTools;%0A
+  exports.EventEmitter = exports.devtools%5B%22require%22%5D(%22devtools/toolkit/event-emitter%22);%0A  exports.ToolSidebar = exports.devtools%5B%22require%22%5D(%22devtools/framework/sidebar%22).ToolSidebar;%0A  exports.CssLogic = exports.devtools%5B%22require%22%5D(%22devtools/styleinspector/css-logic%22).CssLogic;%0A  exports.Widgets = exports.devtools.require(%22devtools/webconsole/console-output%22).Widgets;%0A
 %7D%0A

Put more imports into new devtools module