Bug 1594366 - Move OPTIONS requests for connection priming to avoid repeated execution. r=Neil DONTBUILD
--- 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) {