Bug 1535080, Fix file picker not opening on Windows, r=Gijs a=pascalc
authorJonas Allmann <jallmann@mozilla.com>
Tue, 26 Mar 2019 10:30:39 +0000
changeset 525898 734b7738a6c485a6fd11099fdd9a14920d32b21d
parent 525897 d32f0c0ddb193cafc7ce89a1a4fe5000db4d6e38
child 525899 65b5cf7582293f90fbfbfa7c09ade328cec9fb71
push id2032
push userffxbld-merge
push dateMon, 13 May 2019 09:36:57 +0000
treeherdermozilla-release@455c1065dcbe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs, pascalc
bugs1535080
milestone67.0
Bug 1535080, Fix file picker not opening on Windows, r=Gijs a=pascalc Move addEventhandler to top of appPickerLoad() to avoid not reaching it when errors occur later in the function. Differential Revision: https://phabricator.services.mozilla.com/D24866
toolkit/components/apppicker/content/appPicker.js
--- a/toolkit/components/apppicker/content/appPicker.js
+++ b/toolkit/components/apppicker/content/appPicker.js
@@ -13,16 +13,18 @@ AppPicker.prototype =
     _incomingParams: null,
 
     /**
     * Init the dialog and populate the application list
     */
     appPickerLoad: function appPickerLoad() {
         const nsILocalHandlerApp = Ci.nsILocalHandlerApp;
 
+        document.addEventListener("dialogextra2", function() { g_dialog.appPickerBrowse(); });
+
         this._incomingParams = window.arguments[0];
         this._incomingParams.handlerApp = null;
 
         document.title = this._incomingParams.title;
 
         // Header creation - at the very least, we must have
         // a mime type:
         //
@@ -91,18 +93,16 @@ AppPicker.prototype =
 
           primaryCount++;
         }
 
         if ( primaryCount == 0 ) {
           // display a message saying nothing is configured
           document.getElementById("app-picker-notfound").removeAttribute("hidden");
         }
-
-        document.addEventListener("dialogextra2", function() { g_dialog.appPickerBrowse(); });
     },
 
     /**
     * Retrieve the moz-icon for the app
     */
     getFileIconURL: function getFileIconURL(file) {
       const nsIFileProtocolHandler =
         Ci.nsIFileProtocolHandler;