Bug 1594366 - Move OPTIONS requests for connection priming to avoid repeated execution. r=Neil DONTBUILD
authorBen Bucksch <ben.bucksch@beonex.com>
Tue, 12 Nov 2019 11:19:47 +0100
changeset 37493 7c97fc48c124033f04fb912755b5f2e1309e2354
parent 37492 a9f7c4aa047f78a9f6f21e9206db567de8196f75
child 37494 70edaf9ceae66944922bbe62746f2793c56eeca9
push id396
push userclokep@gmail.com
push dateMon, 06 Jan 2020 23:11:57 +0000
reviewersNeil
bugs1594366
Bug 1594366 - Move OPTIONS requests for connection priming to avoid repeated execution. r=Neil DONTBUILD
mail/components/accountcreation/content/emailWizard.js
--- a/mail/components/accountcreation/content/emailWizard.js
+++ b/mail/components/accountcreation/content/emailWizard.js
@@ -274,16 +274,26 @@ EmailConfigWizard.prototype = {
     // e.g. outgoing username != incoming username.
     _show("status-area");
     _show("result_area");
     _hide("manual-edit_area");
 
     this.switchToMode("start");
     e("realname").select();
     window.sizeToContent();
+
+    // In a new profile, the first request to live.thunderbird.net
+    // is much slower because of one-time overheads.
+    // Let's create some dummy requests to prime the connections.
+    fetch(Services.prefs.getCharPref("mailnews.auto_config_url"), {
+      method: "OPTIONS",
+    });
+    fetch(Services.prefs.getCharPref("mailnews.auto_config.addons_url"), {
+      method: "OPTIONS",
+    });
   },
 
   /**
    * Resize the window based on the content height and width.
    * Since the sizeToContent() method doesn't account for the height of
    * wrapped text, we're checking if the width and height of the "mastervbox"
    * is taller than the window width and height. This is necessary to account
    * for l10n strings or the user manually resizing the window.
@@ -423,26 +433,16 @@ EmailConfigWizard.prototype = {
     if (Services.io.offline) {
       if (this._currentConfig != null) {
         _hide("half-manual-test_button");
         _hide("create_button");
         _hide("manual-edit_button");
       }
     }
     this.resizeDialog();
-
-    // In a new profile, the first request to live.thunderbird.net
-    // is much slower because of one-time overheads.
-    // Let's create some dummy requests to prime the connections.
-    fetch(Services.prefs.getCharPref("mailnews.auto_config_url"), {
-      method: "OPTIONS",
-    });
-    fetch(Services.prefs.getCharPref("mailnews.auto_config.addons_url"), {
-      method: "OPTIONS",
-    });
   },
 
   /**
    * Start from beginning with possibly new email address.
    */
   onStartOver() {
     this._currentConfig = null;
     if (this._abortable) {