Bug 1620919 - Remove ext-menus-child.js. r=mkmelin
authorGeoff Lankow <geoff@darktrojan.net>
Mon, 09 Mar 2020 20:44:58 +1300
changeset 38479 e818b1aff9a84c8eec853acf7702536615944ac0
parent 38478 08098cce2d2c285c53519e1426d728faca0274ff
child 38480 011ee25ec39740ae41c6e045335cfe44d9649915
push id400
push userclokep@gmail.com
push dateMon, 04 May 2020 18:56:09 +0000
reviewersmkmelin
bugs1620919
Bug 1620919 - Remove ext-menus-child.js. r=mkmelin
mail/components/extensions/child/ext-mail.js
mail/components/extensions/child/ext-menus-child.js
mail/components/extensions/jar.mn
--- a/mail/components/extensions/child/ext-mail.js
+++ b/mail/components/extensions/child/ext-mail.js
@@ -5,19 +5,14 @@
 "use strict";
 
 extensions.registerModules({
   menus: {
     url: "chrome://messenger/content/child/ext-menus.js",
     scopes: ["addon_child"],
     paths: [["menus"]],
   },
-  menusChild: {
-    url: "chrome://messenger/content/child/ext-menus-child.js",
-    scopes: ["addon_child", "devtools_child"],
-    paths: [["menus"]],
-  },
   tabs: {
     url: "chrome://messenger/content/child/ext-tabs.js",
     scopes: ["addon_child"],
     paths: [["tabs"]],
   },
 });
deleted file mode 100644
--- a/mail/components/extensions/child/ext-menus-child.js
+++ /dev/null
@@ -1,36 +0,0 @@
-"use strict";
-
-ChromeUtils.defineModuleGetter(
-  this,
-  "ContextMenuChild",
-  "resource:///actors/ContextMenuChild.jsm"
-);
-
-this.menusChild = class extends ExtensionAPI {
-  getAPI(context) {
-    return {
-      menus: {
-        getTargetElement(targetElementId) {
-          let element;
-          let lastMenuTarget = ContextMenuChild.getLastTarget(
-            context.messageManager
-          );
-          if (
-            lastMenuTarget &&
-            Math.floor(lastMenuTarget.timeStamp) === targetElementId
-          ) {
-            element = lastMenuTarget.targetRef.get();
-          }
-          if (
-            element &&
-            element.getRootNode({ composed: true }) ===
-              context.contentWindow.document
-          ) {
-            return element;
-          }
-          return null;
-        },
-      },
-    };
-  }
-};
--- a/mail/components/extensions/jar.mn
+++ b/mail/components/extensions/jar.mn
@@ -2,17 +2,16 @@
 # 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/.
 
 messenger.jar:
     content/messenger/ext-mail.json                (ext-mail.json)
     content/messenger/extension.svg                (extension.svg)
 
     content/messenger/child/ext-mail.js            (child/ext-mail.js)
-    content/messenger/child/ext-menus-child.js     (child/ext-menus-child.js)
     content/messenger/child/ext-menus.js           (child/ext-menus.js)
     content/messenger/child/ext-tabs.js            (child/ext-tabs.js)
 
     content/messenger/parent/ext-accounts.js       (parent/ext-accounts.js)
     content/messenger/parent/ext-addressBook.js    (parent/ext-addressBook.js)
     content/messenger/parent/ext-browserAction.js  (parent/ext-browserAction.js)
     content/messenger/parent/ext-chrome-settings-overrides.js      (parent/ext-chrome-settings-overrides.js)
     content/messenger/parent/ext-cloudFile.js      (parent/ext-cloudFile.js)