Bug 1594366 - Move OPTIONS requests for connection priming to avoid repeated execution. r=Neil a=jorgk
authorBen Bucksch <ben.bucksch@beonex.com>
Tue, 12 Nov 2019 11:19:47 +0100
changeset 37276 54803987a9f82e3c11534b65ce17a2b8a9f7cc03
parent 37275 d79ec50cc44f52b6d5b900203fe70a9f3ce0bca8
child 37277 f9de4d2ba542874f03c273be63666218ecd8f1d2
push id395
push userclokep@gmail.com
push dateMon, 02 Dec 2019 19:38:57 +0000
reviewersNeil, jorgk
bugs1594366
Bug 1594366 - Move OPTIONS requests for connection priming to avoid repeated execution. r=Neil a=jorgk
mail/components/accountcreation/content/emailWizard.js
--- a/mail/components/accountcreation/content/emailWizard.js
+++ b/mail/components/accountcreation/content/emailWizard.js
@@ -275,16 +275,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.
@@ -424,26 +434,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) {