Bug 1172897 - Move DevTools addon modules to subdir. r=ochameau
authorJ. Ryan Stinnett <jryans@gmail.com>
Mon, 04 Jun 2018 18:12:11 -0500
changeset 478579 df974bbe73164a63c8e18e8783a2cf3d0ffbefe1
parent 478578 6ba2146c4238f2a8610ec4f240718a1ba593ee60
child 478580 18d2f516957955c8c0120cb3d888c83a1207e4ec
push id1757
push userffxbld-merge
push dateFri, 24 Aug 2018 17:02:43 +0000
treeherdermozilla-release@736023aebdb1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersochameau
bugs1172897
milestone62.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1172897 - Move DevTools addon modules to subdir. r=ochameau MozReview-Commit-ID: D61WJnoYQe3
devtools/client/framework/devtools.js
devtools/client/inspector/extensions/test/browser_inspector_extension_sidebar.js
devtools/docs/backend/actor-registration.md
devtools/server/actors/addon-console.js
devtools/server/actors/addon.js
devtools/server/actors/addon/addons.js
devtools/server/actors/addon/console.js
devtools/server/actors/addon/moz.build
devtools/server/actors/addon/webextension-inspected-window.js
devtools/server/actors/addon/webextension-parent.js
devtools/server/actors/addon/webextension.js
devtools/server/actors/addons.js
devtools/server/actors/moz.build
devtools/server/actors/webbrowser.js
devtools/server/actors/webconsole.js
devtools/server/actors/webextension-inspected-window.js
devtools/server/actors/webextension-parent.js
devtools/server/actors/webextension.js
devtools/server/main.js
devtools/server/startup/frame.js
devtools/server/tests/browser/browser_webextension_inspected_window.js
devtools/server/tests/unit/test_addons_actor.js
devtools/shared/fronts/addon/addons.js
devtools/shared/fronts/addon/moz.build
devtools/shared/fronts/addon/webextension-inspected-window.js
devtools/shared/fronts/addons.js
devtools/shared/fronts/moz.build
devtools/shared/fronts/webextension-inspected-window.js
devtools/shared/specs/addon/addons.js
devtools/shared/specs/addon/console.js
devtools/shared/specs/addon/moz.build
devtools/shared/specs/addon/webextension-inspected-window.js
devtools/shared/specs/addon/webextension-parent.js
devtools/shared/specs/addons.js
devtools/shared/specs/index.js
devtools/shared/specs/moz.build
devtools/shared/specs/webconsole.js
devtools/shared/specs/webextension-inspected-window.js
devtools/shared/specs/webextension-parent.js
--- a/devtools/client/framework/devtools.js
+++ b/devtools/client/framework/devtools.js
@@ -13,17 +13,17 @@ loader.lazyRequireGetter(this, "TargetFa
 loader.lazyRequireGetter(this, "TabTarget", "devtools/client/framework/target", true);
 loader.lazyRequireGetter(this, "ToolboxHostManager", "devtools/client/framework/toolbox-host-manager", true);
 loader.lazyRequireGetter(this, "HUDService", "devtools/client/webconsole/hudservice", true);
 loader.lazyRequireGetter(this, "Telemetry", "devtools/client/shared/telemetry");
 loader.lazyImporter(this, "ScratchpadManager", "resource://devtools/client/scratchpad/scratchpad-manager.jsm");
 loader.lazyImporter(this, "BrowserToolboxProcess", "resource://devtools/client/framework/ToolboxProcess.jsm");
 
 loader.lazyRequireGetter(this, "WebExtensionInspectedWindowFront",
-      "devtools/shared/fronts/webextension-inspected-window", true);
+      "devtools/shared/fronts/addon/webextension-inspected-window", true);
 
 const {defaultTools: DefaultTools, defaultThemes: DefaultThemes} =
   require("devtools/client/definitions");
 const EventEmitter = require("devtools/shared/event-emitter");
 const {getTheme, setTheme, addThemeObserver, removeThemeObserver} =
   require("devtools/client/shared/theme");
 
 const FORBIDDEN_IDS = new Set(["toolbox", ""]);
--- a/devtools/client/inspector/extensions/test/browser_inspector_extension_sidebar.js
+++ b/devtools/client/inspector/extensions/test/browser_inspector_extension_sidebar.js
@@ -4,17 +4,17 @@
 
 "use strict";
 
 ChromeUtils.defineModuleGetter(this, "ContentTaskUtils",
                                "resource://testing-common/ContentTaskUtils.jsm");
 
 loader.lazyGetter(this, "WebExtensionInspectedWindowFront", () => {
   return require(
-    "devtools/shared/fronts/webextension-inspected-window"
+    "devtools/shared/fronts/addon/webextension-inspected-window"
   ).WebExtensionInspectedWindowFront;
 }, true);
 
 const SIDEBAR_ID = "an-extension-sidebar";
 const SIDEBAR_TITLE = "Sidebar Title";
 
 let extension;
 let fakeExtCallerInfo;
--- a/devtools/docs/backend/actor-registration.md
+++ b/devtools/docs/backend/actor-registration.md
@@ -18,17 +18,17 @@ DebuggerServer.registerModule("devtools/
   constructor: "WebConsoleActor",
   type: { tab: true }
 });
 ```
 
 To register a global actor:
 
 ```
-DebuggerServer.registerModule("devtools/server/actors/addons", {
+DebuggerServer.registerModule("devtools/server/actors/addon/addons", {
   prefix: "addons",
   constructor: "AddonsActor",
   type: { global: true }
 });
 ```
 
 If you are adding a new built-in devtools actor, you should be registering it using `DebuggerServer.registerModule` in `_addBrowserActors` or `addTabActors` in `/devtools/server/main.js`.
 
--- a/devtools/server/actors/addon.js
+++ b/devtools/server/actors/addon.js
@@ -9,17 +9,17 @@ var Services = require("Services");
 var { ActorPool } = require("devtools/server/actors/common");
 var { TabSources } = require("./utils/TabSources");
 var makeDebugger = require("./utils/make-debugger");
 var DevToolsUtils = require("devtools/shared/DevToolsUtils");
 var { assert } = DevToolsUtils;
 
 loader.lazyRequireGetter(this, "AddonThreadActor", "devtools/server/actors/thread", true);
 loader.lazyRequireGetter(this, "unwrapDebuggerObjectGlobal", "devtools/server/actors/thread", true);
-loader.lazyRequireGetter(this, "AddonConsoleActor", "devtools/server/actors/addon-console", true);
+loader.lazyRequireGetter(this, "AddonConsoleActor", "devtools/server/actors/addon/console", true);
 
 loader.lazyImporter(this, "AddonManager", "resource://gre/modules/AddonManager.jsm");
 
 function BrowserAddonActor(connection, addon) {
   this.conn = connection;
   this._addon = addon;
   this._contextPool = new ActorPool(this.conn);
   this.conn.addActorPool(this._contextPool);
rename from devtools/server/actors/addons.js
rename to devtools/server/actors/addon/addons.js
--- a/devtools/server/actors/addons.js
+++ b/devtools/server/actors/addon/addons.js
@@ -2,17 +2,17 @@
  * 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";
 
 const {AddonManager} = require("resource://gre/modules/AddonManager.jsm");
 const protocol = require("devtools/shared/protocol");
 const {FileUtils} = require("resource://gre/modules/FileUtils.jsm");
-const {addonsSpec} = require("devtools/shared/specs/addons");
+const {addonsSpec} = require("devtools/shared/specs/addon/addons");
 
 const AddonsActor = protocol.ActorClassWithSpec(addonsSpec, {
 
   initialize: function(conn) {
     protocol.Actor.prototype.initialize.call(this, conn);
   },
 
   async installTemporaryAddon(addonPath) {
rename from devtools/server/actors/addon-console.js
rename to devtools/server/actors/addon/console.js
--- a/devtools/server/actors/addon-console.js
+++ b/devtools/server/actors/addon/console.js
@@ -6,17 +6,17 @@
 
 var { ConsoleAPIListener } = require("devtools/server/actors/webconsole/listeners");
 var { update } = require("devtools/shared/DevToolsUtils");
 
 loader.lazyRequireGetter(this, "WebConsoleActor", "devtools/server/actors/webconsole", true);
 
 const { extend } = require("devtools/shared/extend");
 const { ActorClassWithSpec, Actor } = require("devtools/shared/protocol");
-const { webconsoleSpec } = require("devtools/shared/specs/webconsole");
+const { addonConsoleSpec } = require("devtools/shared/specs/addon/console");
 
 /**
  * Protocol.js expects only the prototype object, and does not maintain the prototype
  * chain when it constructs the ActorClass. For this reason we are using `extend` to
  * maintain the properties of BrowsingContextTargetActor.prototype
  */
 const addonConsolePrototype = extend({}, WebConsoleActor.prototype);
 
@@ -34,19 +34,16 @@ const addonConsolePrototype = extend({},
  */
 addonConsolePrototype.initialize = function(addon, connection, parentActor) {
   this.addon = addon;
   Actor.prototype.initialize.call(this, connection);
   WebConsoleActor.call(this, connection, parentActor);
 };
 
 update(addonConsolePrototype, {
-  // TODO: remove once webconsole is updated to protocol.js, Bug #1450946
-  actorPrefix: "addonConsole",
-
   /**
    * The add-on that this console watches.
    */
   addon: null,
 
   /**
    * The main add-on JS global
    */
@@ -90,12 +87,9 @@ update(addonConsolePrototype, {
     return {
       startedListeners: startedListeners,
       nativeConsoleAPI: true,
       traits: this.traits,
     };
   },
 });
 
-exports.AddonConsoleActor = ActorClassWithSpec(webconsoleSpec, addonConsolePrototype);
-
-// TODO: remove once protocol.js can handle inheritance. Bug #1450960
-exports.AddonConsoleActor.prototype.typeName = "addonConsole";
+exports.AddonConsoleActor = ActorClassWithSpec(addonConsoleSpec, addonConsolePrototype);
new file mode 100644
--- /dev/null
+++ b/devtools/server/actors/addon/moz.build
@@ -0,0 +1,13 @@
+# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
+# vim: set filetype=python:
+# 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/.
+
+DevToolsModules(
+    'addons.js',
+    'console.js',
+    'webextension-inspected-window.js',
+    'webextension-parent.js',
+    'webextension.js',
+)
rename from devtools/server/actors/webextension-inspected-window.js
rename to devtools/server/actors/addon/webextension-inspected-window.js
--- a/devtools/server/actors/webextension-inspected-window.js
+++ b/devtools/server/actors/addon/webextension-inspected-window.js
@@ -11,17 +11,17 @@ const {Cc, Ci, Cu, Cr} = require("chrome
 const {DebuggerServer} = require("devtools/server/main");
 const Services = require("Services");
 const ChromeUtils = require("ChromeUtils");
 
 loader.lazyGetter(this, "NodeActor", () => require("devtools/server/actors/inspector/node").NodeActor, true);
 
 const {
   webExtensionInspectedWindowSpec,
-} = require("devtools/shared/specs/webextension-inspected-window");
+} = require("devtools/shared/specs/addon/webextension-inspected-window");
 
 const {WebExtensionPolicy} = Cu.getGlobalForObject(require("resource://gre/modules/XPCOMUtils.jsm"));
 
 // A weak set of the documents for which a warning message has been
 // already logged (so that we don't keep emitting the same warning if an
 // extension keeps calling the devtools.inspectedWindow.eval API method
 // when it fails to retrieve a result, but we do log the warning message
 // if the user reloads the window):
rename from devtools/server/actors/webextension-parent.js
rename to devtools/server/actors/addon/webextension-parent.js
--- a/devtools/server/actors/webextension-parent.js
+++ b/devtools/server/actors/addon/webextension-parent.js
@@ -1,17 +1,17 @@
 /* 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";
 
 const {DebuggerServer} = require("devtools/server/main");
 const protocol = require("devtools/shared/protocol");
-const {webExtensionSpec} = require("devtools/shared/specs/webextension-parent");
+const {webExtensionSpec} = require("devtools/shared/specs/addon/webextension-parent");
 
 loader.lazyImporter(this, "AddonManager", "resource://gre/modules/AddonManager.jsm");
 loader.lazyImporter(this, "ExtensionParent", "resource://gre/modules/ExtensionParent.jsm");
 
 /**
  * Creates the actor that represents the addon in the parent process, which connects
  * itself to a WebExtensionChildActor counterpart which is created in the
  * extension process (or in the main process if the WebExtensions OOP mode is disabled).
rename from devtools/server/actors/webextension.js
rename to devtools/server/actors/addon/webextension.js
--- a/devtools/server/actors/moz.build
+++ b/devtools/server/actors/moz.build
@@ -1,33 +1,32 @@
 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # 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/.
 
 DIRS += [
+    'addon',
     'canvas',
     'emulation',
     'highlighters',
     'inspector',
     'object',
     'targets',
     'utils',
     'webconsole',
     'worker',
 ]
 
 DevToolsModules(
     'accessibility-parent.js',
     'accessibility.js',
     'actor-registry.js',
-    'addon-console.js',
     'addon.js',
-    'addons.js',
     'animation-type-longhand.js',
     'animation.js',
     'array-buffer.js',
     'breakpoint.js',
     'call-watcher.js',
     'canvas.js',
     'common.js',
     'css-properties.js',
@@ -61,19 +60,16 @@ DevToolsModules(
     'string.js',
     'styles.js',
     'stylesheets.js',
     'thread.js',
     'timeline.js',
     'webaudio.js',
     'webbrowser.js',
     'webconsole.js',
-    'webextension-inspected-window.js',
-    'webextension-parent.js',
-    'webextension.js',
     'webgl.js',
 )
 
 with Files('animation.js'):
     BUG_COMPONENT = ('Firefox', 'Developer Tools: Animation Inspector')
 
 with Files('breakpoint.js'):
     BUG_COMPONENT = ('Firefox', 'Developer Tools: Debugger')
--- a/devtools/server/actors/webbrowser.js
+++ b/devtools/server/actors/webbrowser.js
@@ -9,17 +9,17 @@
 var { Ci } = require("chrome");
 var Services = require("Services");
 var { DebuggerServer } = require("devtools/server/main");
 var DevToolsUtils = require("devtools/shared/DevToolsUtils");
 
 loader.lazyRequireGetter(this, "RootActor", "devtools/server/actors/root", true);
 loader.lazyRequireGetter(this, "FrameTargetActorProxy", "devtools/server/actors/targets/frame-proxy", true);
 loader.lazyRequireGetter(this, "BrowserAddonActor", "devtools/server/actors/addon", true);
-loader.lazyRequireGetter(this, "WebExtensionParentActor", "devtools/server/actors/webextension-parent", true);
+loader.lazyRequireGetter(this, "WebExtensionParentActor", "devtools/server/actors/addon/webextension-parent", true);
 loader.lazyRequireGetter(this, "WorkerTargetActorList", "devtools/server/actors/worker/worker-list", true);
 loader.lazyRequireGetter(this, "ServiceWorkerRegistrationActorList", "devtools/server/actors/worker/worker-list", true);
 loader.lazyRequireGetter(this, "ProcessActorList", "devtools/server/actors/process", true);
 loader.lazyImporter(this, "AddonManager", "resource://gre/modules/AddonManager.jsm");
 
 /**
  * Browser-specific actors.
  */
--- a/devtools/server/actors/webconsole.js
+++ b/devtools/server/actors/webconsole.js
@@ -305,17 +305,17 @@ WebConsoleActor.prototype =
 
   /**
    * The Web Console Commands names cache.
    * @private
    * @type array
    */
   _webConsoleCommandsCache: null,
 
-  actorPrefix: "console",
+  typeName: "console",
 
   get globalDebugObject() {
     return this.parentActor.threadActor.globalDebugObject;
   },
 
   grip: function() {
     return { actor: this.actorID };
   },
--- a/devtools/server/main.js
+++ b/devtools/server/main.js
@@ -394,17 +394,17 @@ var DebuggerServer = {
       constructor: "PreferenceActor",
       type: { global: true }
     });
     this.registerModule("devtools/server/actors/actor-registry", {
       prefix: "actorRegistry",
       constructor: "ActorRegistryActor",
       type: { global: true }
     });
-    this.registerModule("devtools/server/actors/addons", {
+    this.registerModule("devtools/server/actors/addon/addons", {
       prefix: "addons",
       constructor: "AddonsActor",
       type: { global: true }
     });
     this.registerModule("devtools/server/actors/device", {
       prefix: "device",
       constructor: "DeviceActor",
       type: { global: true }
@@ -522,17 +522,17 @@ var DebuggerServer = {
       constructor: "PromisesActor",
       type: { tab: true }
     });
     this.registerModule("devtools/server/actors/emulation", {
       prefix: "emulation",
       constructor: "EmulationActor",
       type: { tab: true }
     });
-    this.registerModule("devtools/server/actors/webextension-inspected-window", {
+    this.registerModule("devtools/server/actors/addon/webextension-inspected-window", {
       prefix: "webExtensionInspectedWindow",
       constructor: "WebExtensionInspectedWindowActor",
       type: { tab: true }
     });
     this.registerModule("devtools/server/actors/accessibility", {
       prefix: "accessibility",
       constructor: "AccessibilityActor",
       type: { tab: true }
--- a/devtools/server/startup/frame.js
+++ b/devtools/server/startup/frame.js
@@ -48,17 +48,17 @@ try {
       Cu.blockThreadedExecution(() => {
         const conn = DebuggerServer.connectToParent(prefix, mm);
         conn.parentMessageManager = mm;
         connections.set(prefix, conn);
 
         let actor;
 
         if (addonId) {
-          const { WebExtensionChildActor } = require("devtools/server/actors/webextension");
+          const { WebExtensionChildActor } = require("devtools/server/actors/addon/webextension");
           actor = new WebExtensionChildActor(conn, chromeGlobal, prefix, addonId);
         } else {
           const { FrameTargetActor } = require("devtools/server/actors/targets/frame");
           actor = new FrameTargetActor(conn, chromeGlobal);
         }
 
         const actorPool = new ActorPool(conn);
         actorPool.addActor(actor);
--- a/devtools/server/tests/browser/browser_webextension_inspected_window.js
+++ b/devtools/server/tests/browser/browser_webextension_inspected_window.js
@@ -1,17 +1,17 @@
 /* vim: set ft=javascript ts=2 et sw=2 tw=80: */
 /* Any copyright is dedicated to the Public Domain.
  http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 const {
   WebExtensionInspectedWindowFront
-} = require("devtools/shared/fronts/webextension-inspected-window");
+} = require("devtools/shared/fronts/addon/webextension-inspected-window");
 
 const TEST_RELOAD_URL = `${MAIN_DOMAIN}/inspectedwindow-reload-target.sjs`;
 
 async function setup(pageUrl) {
   const extension = ExtensionTestUtils.loadExtension({
     background() {
       // This is just an empty extension used to ensure that the caller extension uuid
       // actually exists.
--- a/devtools/server/tests/unit/test_addons_actor.js
+++ b/devtools/server/tests/unit/test_addons_actor.js
@@ -1,15 +1,15 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 /* eslint-disable no-shadow */
 
 "use strict";
 
-const {AddonsFront} = require("devtools/shared/fronts/addons");
+const {AddonsFront} = require("devtools/shared/fronts/addon/addons");
 
 startupAddonsManager();
 
 async function connect() {
   const client = await new Promise(resolve => {
     get_parent_process_actors(client => resolve(client));
   });
   const root = await listTabs(client);
rename from devtools/shared/fronts/addons.js
rename to devtools/shared/fronts/addon/addons.js
--- a/devtools/shared/fronts/addons.js
+++ b/devtools/shared/fronts/addon/addons.js
@@ -1,14 +1,14 @@
 /* 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";
 
-const {addonsSpec} = require("devtools/shared/specs/addons");
+const {addonsSpec} = require("devtools/shared/specs/addon/addons");
 const protocol = require("devtools/shared/protocol");
 
 const AddonsFront = protocol.FrontClassWithSpec(addonsSpec, {
   initialize: function(client, {addonsActor}) {
     protocol.Front.prototype.initialize.call(this, client);
     this.actorID = addonsActor;
     this.manage(this);
   }
new file mode 100644
--- /dev/null
+++ b/devtools/shared/fronts/addon/moz.build
@@ -0,0 +1,10 @@
+# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
+# vim: set filetype=python:
+# 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/.
+
+DevToolsModules(
+    'addons.js',
+    'webextension-inspected-window.js',
+)
rename from devtools/shared/fronts/webextension-inspected-window.js
rename to devtools/shared/fronts/addon/webextension-inspected-window.js
--- a/devtools/shared/fronts/webextension-inspected-window.js
+++ b/devtools/shared/fronts/addon/webextension-inspected-window.js
@@ -1,16 +1,16 @@
 /* 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";
 
 const {
   webExtensionInspectedWindowSpec,
-} = require("devtools/shared/specs/webextension-inspected-window");
+} = require("devtools/shared/specs/addon/webextension-inspected-window");
 
 const protocol = require("devtools/shared/protocol");
 
 /**
  * The corresponding Front object for the WebExtensionInspectedWindowActor.
  */
 const WebExtensionInspectedWindowFront = protocol.FrontClassWithSpec(
   webExtensionInspectedWindowSpec,
--- a/devtools/shared/fronts/moz.build
+++ b/devtools/shared/fronts/moz.build
@@ -1,18 +1,21 @@
 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # 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/.
 
+DIRS += [
+    'addon',
+]
+
 DevToolsModules(
     'accessibility.js',
     'actor-registry.js',
-    'addons.js',
     'animation.js',
     'call-watcher.js',
     'canvas.js',
     'css-properties.js',
     'csscoverage.js',
     'device.js',
     'emulation.js',
     'framerate.js',
@@ -29,11 +32,10 @@ DevToolsModules(
     'promises.js',
     'reflow.js',
     'storage.js',
     'string.js',
     'styles.js',
     'stylesheets.js',
     'timeline.js',
     'webaudio.js',
-    'webextension-inspected-window.js',
     'webgl.js'
 )
rename from devtools/shared/specs/addons.js
rename to devtools/shared/specs/addon/addons.js
new file mode 100644
--- /dev/null
+++ b/devtools/shared/specs/addon/console.js
@@ -0,0 +1,14 @@
+/* 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";
+
+const { generateActorSpec } = require("devtools/shared/protocol");
+const { extend } = require("devtools/shared/extend");
+const { webconsoleSpecPrototype } = require("devtools/shared/specs/webconsole");
+
+const addonConsoleSpec = generateActorSpec(extend(webconsoleSpecPrototype, {
+  typeName: "addonConsole",
+}));
+
+exports.addonConsoleSpec = addonConsoleSpec;
new file mode 100644
--- /dev/null
+++ b/devtools/shared/specs/addon/moz.build
@@ -0,0 +1,12 @@
+# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
+# vim: set filetype=python:
+# 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/.
+
+DevToolsModules(
+    'addons.js',
+    'console.js',
+    'webextension-inspected-window.js',
+    'webextension-parent.js',
+)
rename from devtools/shared/specs/webextension-inspected-window.js
rename to devtools/shared/specs/addon/webextension-inspected-window.js
rename from devtools/shared/specs/webextension-parent.js
rename to devtools/shared/specs/addon/webextension-parent.js
--- a/devtools/shared/specs/index.js
+++ b/devtools/shared/specs/index.js
@@ -19,18 +19,33 @@ const Types = exports.__TypesForTests = 
   },
   {
     types: ["actorActor", "actorRegistry"],
     spec: "devtools/shared/specs/actor-registry",
     front: "devtools/shared/fronts/actor-registry",
   },
   {
     types: ["addons"],
-    spec: "devtools/shared/specs/addons",
-    front: "devtools/shared/fronts/addons",
+    spec: "devtools/shared/specs/addon/addons",
+    front: "devtools/shared/fronts/addon/addons",
+  },
+  {
+    types: ["addonConsole"],
+    spec: "devtools/shared/specs/addon/console",
+    front: null,
+  },
+  {
+    types: ["webExtensionInspectedWindow"],
+    spec: "devtools/shared/specs/addon/webextension-inspected-window",
+    front: "devtools/shared/fronts/addon/webextension-inspected-window",
+  },
+  {
+    types: ["webExtensionAddon"],
+    spec: "devtools/shared/specs/addon/webextension-parent",
+    front: null,
   },
   {
     types: ["animationplayer", "animations"],
     spec: "devtools/shared/specs/animation",
     front: "devtools/shared/fronts/animation",
   },
   /* breakpoint has old fashion client and no front */
   {
@@ -250,26 +265,16 @@ const Types = exports.__TypesForTests = 
     front: "devtools/shared/fronts/webaudio",
   },
   {
     types: ["console"],
     spec: "devtools/shared/specs/webconsole",
     front: null,
   },
   {
-    types: ["webExtensionInspectedWindow"],
-    spec: "devtools/shared/specs/webextension-inspected-window",
-    front: "devtools/shared/fronts/webextension-inspected-window",
-  },
-  {
-    types: ["webExtensionAddon"],
-    spec: "devtools/shared/specs/webextension-parent",
-    front: null,
-  },
-  {
     types: ["gl-shader", "gl-program", "webgl"],
     spec: "devtools/shared/specs/webgl",
     front: "devtools/shared/fronts/webgl",
   },
   {
     types: ["pushSubscription", "serviceWorkerRegistration", "serviceWorker"],
     spec: "devtools/shared/specs/worker/service-worker",
     front: null,
--- a/devtools/shared/specs/moz.build
+++ b/devtools/shared/specs/moz.build
@@ -1,23 +1,23 @@
 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # 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/.
 
 DIRS += [
+    'addon',
     'targets',
     'worker',
 ]
 
 DevToolsModules(
     'accessibility.js',
     'actor-registry.js',
-    'addons.js',
     'animation.js',
     'breakpoint.js',
     'call-watcher.js',
     'canvas.js',
     'css-properties.js',
     'csscoverage.js',
     'device.js',
     'emulation.js',
@@ -46,12 +46,10 @@ DevToolsModules(
     'string.js',
     'styles.js',
     'stylesheets.js',
     'symbol-iterator.js',
     'symbol.js',
     'timeline.js',
     'webaudio.js',
     'webconsole.js',
-    'webextension-inspected-window.js',
-    'webextension-parent.js',
     'webgl.js',
 )
--- a/devtools/shared/specs/webconsole.js
+++ b/devtools/shared/specs/webconsole.js
@@ -1,11 +1,12 @@
 /* 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";
 
 const {types, generateActorSpec, RetVal, Option} = require("devtools/shared/protocol");
 
 types.addDictType("console.traits", {
   evaluateJSAsync: "boolean",
   transferredResponseSize: "boolean",
   selectedObjectActor: "boolean",
@@ -31,17 +32,17 @@ types.addDictType("console.cachedmessage
   // this type is a union of two potential return types:
   // { error, message } and { _type, message, timeStamp }
   error: "nullable:string",
   message: "longstring",
   _type: "nullable:string",
   timeStamp: "nullable:string"
 });
 
-const webconsoleSpec = generateActorSpec({
+const webconsoleSpecPrototype = {
   typeName: "console",
 
   methods: {
     startListeners: {
       request: {
         listeners: Option(0, "array:string"),
       },
       response: RetVal("console.startlisteners")
@@ -109,11 +110,14 @@ const webconsoleSpec = generateActorSpec
     },
     sendHTTPRequest: {
       request: {
         request: Option(0, "json")
       },
       response: RetVal("json")
     }
   }
-});
+};
 
+const webconsoleSpec = generateActorSpec(webconsoleSpecPrototype);
+
+exports.webconsoleSpecPrototype = webconsoleSpecPrototype;
 exports.webconsoleSpec = webconsoleSpec;