Bug 1607515 - Add a drop handler to restored Add-Ons Manager tabs; r=mkmelin
authorGeoff Lankow <geoff@darktrojan.net>
Tue, 14 Jan 2020 11:02:10 +1300
changeset 37080 f1c1cd523798d8bc4c45bcfea083fbf66d7162ed
parent 37079 ed741aa127edc115ccfdd103b864e77891fef371
child 37081 446e3aafa9b9293168233e09a674e91dd33fcdc9
push id2552
push userclokep@gmail.com
push dateMon, 10 Feb 2020 21:24:16 +0000
treeherdercomm-beta@f95a6f4408a3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmkmelin
bugs1607515
Bug 1607515 - Add a drop handler to restored Add-Ons Manager tabs; r=mkmelin
mail/base/content/mailCore.js
mail/base/content/specialTabs.js
--- a/mail/base/content/mailCore.js
+++ b/mail/base/content/mailCore.js
@@ -583,16 +583,17 @@ function openAddonsMgr(aView) {
     }
 
     // This must be a new load, else the ping/pong would have
     // found the window above.
     let addonSiteRegExp = Services.prefs.getCharPref(
       "extensions.getAddons.siteRegExp"
     );
     let tab = openContentTab("about:addons", "tab", addonSiteRegExp);
+    // Also in `contentTabType.restoreTab` in specialTabs.js.
     tab.browser.droppedLinkHandler = event =>
       tab.browser.contentWindow.gDragDrop.onDrop(event);
 
     Services.obs.addObserver(function observer(aSubject, aTopic, aData) {
       Services.obs.removeObserver(observer, aTopic);
       if (aView) {
         aSubject.loadView(aView);
       }
--- a/mail/base/content/specialTabs.js
+++ b/mail/base/content/specialTabs.js
@@ -988,22 +988,27 @@ var specialTabs = {
       let onClick = aTab.clickHandler;
 
       return {
         tabURI: aTab.browser.currentURI.spec,
         clickHandler: onClick ? onClick : null,
       };
     },
     restoreTab(aTabmail, aPersistedState) {
-      aTabmail.openTab("contentTab", {
+      let tab = aTabmail.openTab("contentTab", {
         contentPage: aPersistedState.tabURI,
         clickHandler: aPersistedState.clickHandler,
         duplicate: aPersistedState.duplicate,
         background: true,
       });
+      if (aPersistedState.tabURI == "about:addons") {
+        // Also in `openAddonsMgr` in mailCore.js.
+        tab.browser.droppedLinkHandler = event =>
+          tab.browser.contentWindow.gDragDrop.onDrop(event);
+      }
     },
   },
 
   /**
    * Split a version number into a triple (major, minor, extension)
    * For example, 7.0.1 => [7, 0, 1]
    *             10.1a3 => [10, 1, a3]
    *             10.0 => [10, 0, ""]