Bug 1498569, Replace wizard.xml attributes with event listeners, r=Gijs
authorJonas Allmann <jallmann@mozilla.com>
Tue, 02 Apr 2019 08:56:25 +0000
changeset 467553 156372e0b1657631f83b6a065a2367e342099a33
parent 467552 cff212107d958f87f735f80490b52cc414b6281b
child 467554 cb394c9bb56d3a5a9e214c1c97e6a63318754083
push id112633
push usercbrindusan@mozilla.com
push dateTue, 02 Apr 2019 15:52:18 +0000
treeherdermozilla-inbound@a6c6359636f7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs
bugs1498569
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1498569, Replace wizard.xml attributes with event listeners, r=Gijs * Removed all occurences of custom onwizard* attributes. * Removed custom handler code from wizard.xml. * Updated eval()-usage whitelist. Differential Revision: https://phabricator.services.mozilla.com/D24033
browser/components/migration/content/migration.js
browser/components/migration/content/migration.xul
modules/libpref/init/all.js
toolkit/content/widgets/wizard.xml
toolkit/mozapps/update/content/updates.js
toolkit/mozapps/update/content/updates.xul
toolkit/profile/content/createProfileWizard.js
toolkit/profile/content/createProfileWizard.xul
--- a/browser/components/migration/content/migration.js
+++ b/browser/components/migration/content/migration.js
@@ -45,16 +45,30 @@ var MigrationWizard = { /* exported Migr
 
       if (this._autoMigrate) {
         // Show the "nothing" option in the automigrate case to provide an
         // easily identifiable way to avoid migration and create a new profile.
         document.getElementById("nothing").hidden = false;
       }
     }
 
+    document.addEventListener("wizardcancel", function() { MigrationWizard.onWizardCancel(); });
+
+    document.getElementById("selectProfile").addEventListener("pageshow", function() { MigrationWizard.onSelectProfilePageShow(); });
+    document.getElementById("importItems").addEventListener("pageshow", function() { MigrationWizard.onImportItemsPageShow(); });
+    document.getElementById("migrating").addEventListener("pageshow", function() { MigrationWizard.onMigratingPageShow(); });
+    document.getElementById("done").addEventListener("pageshow", function() { MigrationWizard.onDonePageShow(); });
+
+    document.getElementById("selectProfile").addEventListener("pagerewound", function() { MigrationWizard.onSelectProfilePageRewound(); });
+    document.getElementById("importItems").addEventListener("pagerewound", function() { MigrationWizard.onImportItemsPageRewound(); });
+
+    document.getElementById("selectProfile").addEventListener("pageadvanced", function() { MigrationWizard.onSelectProfilePageAdvanced(); });
+    document.getElementById("importItems").addEventListener("pageadvanced", function() { MigrationWizard.onImportItemsPageAdvanced(); });
+    document.getElementById("importSource").addEventListener("pageadvanced", function(e) { MigrationWizard.onImportSourcePageAdvanced(e); });
+
     this.onImportSourcePageShow();
   },
 
   uninit() {
     var os = Services.obs;
     os.removeObserver(this, "Migration:Started");
     os.removeObserver(this, "Migration:ItemBeforeMigrate");
     os.removeObserver(this, "Migration:ItemAfterMigrate");
@@ -140,27 +154,27 @@ var MigrationWizard = { /* exported Migr
 
     // Advance to the next page if the caller told us to.
     if (this._migrator && this._skipImportSourcePage) {
       this._wiz.advance();
       this._wiz.canRewind = false;
     }
   },
 
-  onImportSourcePageAdvanced() {
+  onImportSourcePageAdvanced(event) {
     var newSource = document.getElementById("importSourceGroup").selectedItem.id;
 
     if (newSource == "nothing") {
       // Need to do telemetry here because we're closing the dialog before we get to
       // do actual migration. For actual migration, this doesn't happen until after
       // migration takes place.
       Services.telemetry.getHistogramById("FX_MIGRATION_SOURCE_BROWSER")
                         .add(MigrationUtils.getSourceIdForTelemetry("nothing"));
       document.documentElement.cancel();
-      return false;
+      event.preventDefault();
     }
 
     if (!this._migrator || (newSource != this._source)) {
       // Create the migrator for the selected source.
       this._migrator = this.spinResolve(MigrationUtils.getMigrator(newSource));
 
       this._itemsFlags = kIMig.ALL;
       this._selectedProfile = null;
@@ -179,17 +193,16 @@ var MigrationWizard = { /* exported Migr
       else
         this._wiz.currentPage.next = "importItems";
 
       if (sourceProfiles && sourceProfiles.length == 1)
         this._selectedProfile = sourceProfiles[0];
       else
         this._selectedProfile = null;
     }
-    return undefined;
   },
 
   // 2 - [Profile Selection]
   onSelectProfilePageShow() {
     // Disabling this for now, since we ask about import sources in automigration
     // too and don't want to disable the back button
     // if (this._autoMigrate)
     //   document.documentElement.getButton("back").disabled = true;
--- a/browser/components/migration/content/migration.xul
+++ b/browser/components/migration/content/migration.xul
@@ -10,25 +10,23 @@
 <wizard id="migrationWizard"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         windowtype="Browser:MigrationWizard"
         title="&migrationWizard.title;"
         onload="MigrationWizard.init()"
         onunload="MigrationWizard.uninit()"
         style="width: 40em;"
         buttons="accept,cancel"
-        branded="true"
-        onwizardcancel="return MigrationWizard.onWizardCancel();">
+        branded="true">
 
   <script type="application/javascript" src="chrome://global/content/customElements.js"/>
   <script type="application/javascript" src="chrome://browser/content/migration/migration.js"/>
 
   <wizardpage id="importSource" pageid="importSource" next="selectProfile"
-              label="&importSource.title;"
-              onpageadvanced="return MigrationWizard.onImportSourcePageAdvanced();">
+              label="&importSource.title;">
 #ifdef XP_WIN
     <description id="importAll" control="importSourceGroup">&importFrom.label;</description>
 #else
     <description id="importAll" control="importSourceGroup">&importFromUnix.label;</description>
 #endif
     <description id="importBookmarks" control="importSourceGroup" hidden="true">&importFromBookmarks.label;</description>
 
     <radiogroup id="importSourceGroup" align="start">
@@ -55,45 +53,36 @@
       <radio id="nothing"   label="&importFromNothing.label;"   accesskey="&importFromNothing.accesskey;" hidden="true"/>
     </radiogroup>
     <label id="noSources" hidden="true">&noMigrationSources.label;</label>
     <spacer flex="1"/>
     <description class="header" id="closeSourceBrowser" style="visibility:hidden">&closeSourceBrowser.label;</description>
   </wizardpage>
 
   <wizardpage id="selectProfile" pageid="selectProfile" label="&selectProfile.title;"
-              next="importItems"
-              onpageshow="return MigrationWizard.onSelectProfilePageShow();"
-              onpagerewound="return MigrationWizard.onSelectProfilePageRewound();"
-              onpageadvanced="return MigrationWizard.onSelectProfilePageAdvanced();">
+              next="importItems">
     <description control="profiles">&selectProfile.label;</description>
 
     <radiogroup id="profiles" align="left"/>
   </wizardpage>
 
   <wizardpage id="importItems" pageid="importItems" label="&importItems.title;"
               next="migrating"
-              onpageshow="return MigrationWizard.onImportItemsPageShow();"
-              onpagerewound="return MigrationWizard.onImportItemsPageRewound();"
-              onpageadvanced="return MigrationWizard.onImportItemsPageAdvanced();"
               oncommand="MigrationWizard.onImportItemCommand();">
     <description control="dataSources">&importItems.label;</description>
 
     <vbox id="dataSources" style="overflow: auto; -moz-appearance: listbox" align="left" flex="1" role="group"/>
   </wizardpage>
 
   <wizardpage id="migrating" pageid="migrating" label="&migrating.title;"
-              next="done"
-              onpageshow="MigrationWizard.onMigratingPageShow();">
+              next="done">
     <description control="migratingItems">&migrating.label;</description>
 
     <vbox id="migratingItems" style="overflow: auto;" align="left" role="group"/>
   </wizardpage>
 
-  <wizardpage id="done" pageid="done" label="&done.title;"
-              onpageshow="MigrationWizard.onDonePageShow();">
+  <wizardpage id="done" pageid="done" label="&done.title;">
     <description control="doneItems">&done.label;</description>
 
     <vbox id="doneItems" style="overflow: auto;" align="left" role="group"/>
   </wizardpage>
 
 </wizard>
-
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -2691,17 +2691,17 @@ pref("security.notification_enable_delay
 
 #if defined(DEBUG) && !defined(ANDROID)
 pref("csp.about_uris_without_csp", "blank,printpreview,srcdoc,about,addons,cache-entry,config,crashes,debugging,devtools,downloads,home,memory,networking,newtab,performance,plugins,policies,profiles,restartrequired,serviceworkers,sessionrestore,support,sync-log,telemetry,url-classifier,webrtc,welcomeback");
 // the following prefs are for testing purposes only.
 pref("csp.overrule_about_uris_without_csp_whitelist", false);
 pref("csp.skip_about_page_has_csp_assert", false);
 // assertion flag will be set to false after fixing Bug 1473549
 pref("security.allow_eval_with_system_principal", false);
-pref("security.uris_using_eval_with_system_principal", "autocomplete.xml,redux.js,react-redux.js,content-task.js,content-task.js,tree.xml,dialog.xml,preferencesbindings.js,wizard.xml,lodash.js,jszip.js,sinon-7.2.7.js,ajv-4.1.1.js,updates.js,setup,jsol.js,parent_utils.js,chrometask_chromescript");
+pref("security.uris_using_eval_with_system_principal", "autocomplete.xml,redux.js,react-redux.js,content-task.js,content-task.js,tree.xml,dialog.xml,preferencesbindings.js,lodash.js,jszip.js,sinon-7.2.7.js,ajv-4.1.1.js,updates.js,setup,jsol.js,parent_utils.js,chrometask_chromescript");
 #endif
 
 // Default Content Security Policy to apply to signed contents.
 pref("security.signed_content.CSP.default", "script-src 'self'; style-src 'self'");
 
 // Mixed content blocking
 pref("security.mixed_content.block_active_content", false);
 pref("security.mixed_content.block_display_content", false);
--- a/toolkit/content/widgets/wizard.xml
+++ b/toolkit/content/widgets/wizard.xml
@@ -439,28 +439,17 @@
         <parameter name="aTarget"/>
         <parameter name="aType"/>
         <body>
         <![CDATA[
           var event = document.createEvent("Events");
           event.initEvent(aType, true, true);
 
           // handle dom event handlers
-          var noCancel = aTarget.dispatchEvent(event);
-
-          // handle any xml attribute event handlers
-          var handler = aTarget.getAttribute("on"+aType);
-          if (handler != "") {
-            var fn = new Function("event", handler);
-            var returned = fn.apply(aTarget, [event]);
-            if (returned == false)
-              noCancel = false;
-          }
-
-          return noCancel;
+          return aTarget.dispatchEvent(event);
         ]]>
         </body>
       </method>
 
     </implementation>
 
     <handlers>
       <handler event="keypress" keycode="VK_RETURN"
--- a/toolkit/mozapps/update/content/updates.js
+++ b/toolkit/mozapps/update/content/updates.js
@@ -303,16 +303,40 @@ var gUpdates = {
     }
 
     // Cache the standard button labels in case we need to restore them
     this._cacheButtonStrings("next");
     this._cacheButtonStrings("finish");
     this._cacheButtonStrings("extra1");
     this._cacheButtonStrings("extra2");
 
+    document.addEventListener("wizardfinish", function() { gUpdates.onWizardFinish(); });
+    document.addEventListener("wizardcancel", function() { gUpdates.onWizardCancel(); });
+    document.addEventListener("wizardnext", function() { gUpdates.onWizardNext(); });
+
+    document.getElementById("checking").addEventListener("pageshow", function() { gCheckingPage.onPageShow(); });
+    document.getElementById("noupdatesfound").addEventListener("pageshow", function() { gNoUpdatesPage.onPageShow(); });
+    document.getElementById("manualUpdate").addEventListener("pageshow", function() { gManualUpdatePage.onPageShow(); });
+    document.getElementById("unsupported").addEventListener("pageshow", function() { gUnsupportedPage.onPageShow(); });
+    document.getElementById("updatesfoundbasic").addEventListener("pageshow", function() { gUpdatesFoundBasicPage.onPageShow(); });
+    document.getElementById("downloading").addEventListener("pageshow", function() { gDownloadingPage.onPageShow(); });
+    document.getElementById("errors").addEventListener("pageshow", function() { gErrorsPage.onPageShow(); });
+    document.getElementById("errorextra").addEventListener("pageshow", function() { gErrorExtraPage.onPageShow(); });
+    document.getElementById("errorpatching").addEventListener("pageshow", function() { gErrorPatchingPage.onPageShow(); });
+    document.getElementById("finished").addEventListener("pageshow", function() { gFinishedPage.onPageShow(); });
+    document.getElementById("finishedBackground").addEventListener("pageshow", function() { gFinishedPage.onPageShowBackground(); });
+
+    document.getElementById("updatesfoundbasic").addEventListener("extra1", function() { gUpdatesFoundBasicPage.onExtra1(); });
+    document.getElementById("downloading").addEventListener("extra1", function() { gDownloadingPage.onHide(); });
+    document.getElementById("finished").addEventListener("extra1", function() { gFinishedPage.onExtra1(); });
+    document.getElementById("finishedBackground").addEventListener("extra1", function() { gFinishedPage.onExtra1(); });
+
+    document.getElementById("updatesfoundbasic").addEventListener("extra2", function() { gUpdatesFoundBasicPage.onExtra2(); });
+    document.getElementById("finishedBackground").addEventListener("extra2", function() { gFinishedPage.onExtra2(); });
+
     // Advance to the Start page.
     this.getStartPageID(function(startPageID) {
       LOG("gUpdates", "onLoad - setting current page to startpage " + startPageID);
       gUpdates.wiz.currentPage = document.getElementById(startPageID);
     });
   },
 
   /**
--- a/toolkit/mozapps/update/content/updates.xul
+++ b/toolkit/mozapps/update/content/updates.xul
@@ -19,19 +19,16 @@
 ]>
 
 <wizard id="updates"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         xmlns:html="http://www.w3.org/1999/xhtml"
         title="&updateWizard.title;"
         windowtype="Update:Wizard"
         style="width: auto; height: auto"
-        onwizardfinish="gUpdates.onWizardFinish();"
-        onwizardcancel="gUpdates.onWizardCancel();"
-        onwizardnext="gUpdates.onWizardNext();"
         onload="gUpdates.onLoad();"
         onunload="gUpdates.onUnload();">
 
   <script type="application/javascript" src="chrome://global/content/contentAreaUtils.js"/>
   <script type="application/javascript" src="chrome://mozapps/content/update/updates.js"/>
   <script type="application/javascript" src="chrome://global/content/globalOverlay.js"/>
   <script type="application/javascript" src="chrome://global/content/editMenuOverlay.js"/>
 
@@ -42,68 +39,63 @@
   <stringbundleset id="updateSet">
     <stringbundle id="brandStrings" src="chrome://branding/locale/brand.properties"/>
     <stringbundle id="updateStrings" src="chrome://mozapps/locale/update/updates.properties"/>
   </stringbundleset>
 
   <wizardpage id="dummy" pageid="dummy" firstpage="true"/>
 
   <wizardpage id="checking" pageid="checking" next="noupdatesfound"
-              object="gCheckingPage" onpageshow="gCheckingPage.onPageShow();">
+              object="gCheckingPage">
     <updateheader label="&checking.title;"/>
     <vbox class="update-content" flex="1">
       <label>&updateCheck.label;</label>
       <separator class="thin"/>
       <html:progress id="checkingProgress"/>
     </vbox>
   </wizardpage>
 
   <wizardpage id="noupdatesfound" pageid="noupdatesfound"
-              object="gNoUpdatesPage" onpageshow="gNoUpdatesPage.onPageShow();">
+              object="gNoUpdatesPage">
     <updateheader label="&noupdatesfound.title;"/>
     <vbox class="update-content" flex="1">
       <label id="noUpdatesAutoEnabled" hidden="true">&noupdatesautoenabled.intro;</label>
       <label id="noUpdatesAutoDisabled" hidden="true">&noupdatesautodisabled.intro;</label>
     </vbox>
   </wizardpage>
 
-  <wizardpage id="manualUpdate" pageid="manualUpdate" object="gManualUpdatePage"
-              onpageshow="gManualUpdatePage.onPageShow();">
+  <wizardpage id="manualUpdate" pageid="manualUpdate" object="gManualUpdatePage">
     <updateheader label="&manualUpdate.title;"/>
     <vbox class="update-content" flex="1">
       <label id="manualUpdateDesc">&manualUpdate.desc;</label>
       <label id="manualUpdateSpaceDesc"
              hidden="true">&manualUpdate.space.desc;</label>
       <separator class="thin"/>
       <label>&manualUpdateGetMsg.label;</label>
       <hbox>
         <label id="manualUpdateLinkLabel" value="" is="text-link"
                onclick="openUpdateURL(event);"/>
       </hbox>
     </vbox>
   </wizardpage>
 
   <wizardpage id="unsupported" pageid="unsupported"
-              object="gUnsupportedPage"
-              onpageshow="gUnsupportedPage.onPageShow();">
+              object="gUnsupportedPage">
     <updateheader label="&unsupported.title;"/>
     <vbox class="update-content" flex="1">
       <description flex="1">&unsupported.label;
         <label id="unsupportedLinkLabel" class="inline-link" onclick="openUpdateURL(event);" is="text-link">
           &unsupportedLink.label;
         </label>
       </description>
     </vbox>
   </wizardpage>
 
   <wizardpage id="updatesfoundbasic" pageid="updatesfoundbasic"
-              object="gUpdatesFoundBasicPage" next="downloading"
-              onpageshow="gUpdatesFoundBasicPage.onPageShow();"
-              onextra1="gUpdatesFoundBasicPage.onExtra1();"
-              onextra2="gUpdatesFoundBasicPage.onExtra2();">
+              object="gUpdatesFoundBasicPage" next="downloading">
     <updateheader id="updatesFoundBasicHeader" label=""/>
     <vbox class="update-content" flex="1">
       <label id="updatesFoundInto"/>
       <separator class="thin"/>
       <label id="updateName" crop="right" value=""/>
       <separator id="updateNameSep" class="thin"/>
       <label id="upgradeEvangelism">&evangelism.desc;</label>
       <separator id="upgradeEvangelismSep" flex="1"/>
@@ -112,18 +104,17 @@
           <label id="updateMoreInfoURL" is="text-link"
                  value="&clickHere.label;" onclick="openUpdateURL(event);"/>
         </hbox>
       </vbox>
     </vbox>
   </wizardpage>
 
   <wizardpage id="downloading" pageid="downloading"
-              object="gDownloadingPage" onextra1="gDownloadingPage.onHide();"
-              onpageshow="gDownloadingPage.onPageShow();">
+              object="gDownloadingPage">
     <updateheader label="&downloadPage.title;"/>
     <vbox class="update-content" flex="1">
       <hbox id="downloadStatusProgress">
         <html:progress id="downloadProgress" max="100"/>
         <button id="pauseButton" oncommand="gDownloadingPage.onPause();"
                 paused="false"/>
       </hbox>
       <separator class="thin"/>
@@ -133,67 +124,60 @@
       <separator/>
       <hbox id="verificationFailed" align="start" hidden="true">
         <image id="verificationFailedIcon"/>
         <label flex="1">&verificationFailedText.label;</label>
       </hbox>
     </vbox>
   </wizardpage>
 
-  <wizardpage id="errors" pageid="errors" object="gErrorsPage"
-              onpageshow="gErrorsPage.onPageShow();">
+  <wizardpage id="errors" pageid="errors" object="gErrorsPage">
     <updateheader label="&error.title;"/>
     <vbox class="update-content" flex="1">
       <label id="errorIntro">&error.label;</label>
       <separator/>
       <html:textarea class="plain" readonly="readonly" id="errorReason" rows="3"/>
       <separator/>
       <label id="errorManual">&errorManual.label;</label>
       <hbox>
         <label id="errorLinkLabel" value="" is="text-link"
                onclick="openUpdateURL(event);"/>
       </hbox>
     </vbox>
   </wizardpage>
 
   <wizardpage id="errorextra" pageid="errorextra"
-              object="gErrorExtraPage"
-              onpageshow="gErrorExtraPage.onPageShow();">
+              object="gErrorExtraPage">
     <updateheader label="&error.title;"/>
     <vbox class="update-content" flex="1">
       <label id="bgErrorLabel">&genericBackgroundError.label;</label>
       <hbox>
         <label id="errorExtraLinkLabel" is="text-link"
                value="" onclick="openUpdateURL(event);"/>
       </hbox>
     </vbox>
   </wizardpage>
 
   <wizardpage id="errorpatching" pageid="errorpatching" next="downloading"
-              object="gErrorPatchingPage"
-              onpageshow="gErrorPatchingPage.onPageShow();">
+              object="gErrorPatchingPage">
     <updateheader label="&error.title;"/>
     <vbox class="update-content" flex="1">
       <label>&errorpatching.intro;</label>
     </vbox>
   </wizardpage>
 
-  <wizardpage id="finished" pageid="finished" object="gFinishedPage"
-              onpageshow="gFinishedPage.onPageShow();"
-              onextra1="gFinishedPage.onExtra1()">
+  <wizardpage id="finished" pageid="finished" object="gFinishedPage">
     <updateheader label="&finishedPage.title;"/>
     <vbox class="update-content" flex="1">
       <label>&finishedPage.text;</label>
     </vbox>
   </wizardpage>
 
   <wizardpage id="finishedBackground" pageid="finishedBackground"
-              object="gFinishedPage" onextra1="gFinishedPage.onExtra1()"
-              onextra2="gFinishedPage.onExtra2()"
-              onpageshow="gFinishedPage.onPageShowBackground();">
+              object="gFinishedPage">
     <updateheader label="&finishedPage.title;"/>
     <vbox class="update-content" flex="1">
       <label>&finishedBackgroundPage.text;</label>
       <separator/>
       <hbox align="center">
         <label>&finishedBackground.name;</label>
         <label id="updateFinishedName" flex="1" crop="right" value=""/>
         <label id="finishedBackgroundLink" disabled="true" is="text-link"
--- a/toolkit/profile/content/createProfileWizard.js
+++ b/toolkit/profile/content/createProfileWizard.js
@@ -26,16 +26,19 @@ function initWizard() {
   try {
     gProfileService = C[ToolkitProfileService].getService(I.nsIToolkitProfileService);
     gProfileManagerBundle = document.getElementById("bundle_profileManager");
 
     gDefaultProfileParent = Services.dirsvc.get("DefProfRt", I.nsIFile);
 
     // Initialize the profile location display.
     gProfileDisplay = document.getElementById("profileDisplay").firstChild;
+    document.addEventListener("wizardfinish", onFinish);
+    document.getElementById("explanation").addEventListener("pageshow", enableNextButton);
+    document.getElementById("createProfile").addEventListener("pageshow", initSecondWizardPage);
     setDisplayToDefaultFolder();
   } catch (e) {
     window.close();
     throw (e);
   }
 }
 
 // Called every time the second wizard page is displayed.
@@ -164,42 +167,40 @@ function profileExists(aName) {
   return false;
 }
 
 // Called when the first wizard page is shown.
 function enableNextButton() {
   document.documentElement.canAdvance = true;
 }
 
-function onFinish() {
+function onFinish(event) {
   var profileName = document.getElementById("profileName").value;
   var profile;
 
   // Create profile named profileName in profileRoot.
   try {
     profile = gProfileService.createProfile(gProfileRoot, profileName);
   } catch (e) {
     var profileCreationFailed =
       gProfileManagerBundle.getString("profileCreationFailed");
     var profileCreationFailedTitle =
       gProfileManagerBundle.getString("profileCreationFailedTitle");
     Services.prompt.alert(window, profileCreationFailedTitle,
                           profileCreationFailed + "\n" + e);
 
-    return false;
+    event.preventDefault();
+    return;
   }
 
   // window.opener is false if the Create Profile Wizard was opened from the
   // command line.
   if (window.opener) {
     // Add new profile to the list in the Profile Manager.
     window.opener.CreateProfile(profile);
   } else {
     // Use the newly created Profile.
     var profileLock = profile.lock(null);
 
     var dialogParams = window.arguments[0].QueryInterface(I.nsIDialogParamBlock);
     dialogParams.objects.insertElementAt(profileLock, 0);
   }
-
-  // Exit the wizard.
-  return true;
 }
--- a/toolkit/profile/content/createProfileWizard.xul
+++ b/toolkit/profile/content/createProfileWizard.xul
@@ -12,44 +12,43 @@
 %profileDTD;
 ]>
 
 <wizard id="createProfileWizard"
         title="&newprofile.title;"
         xmlns:html="http://www.w3.org/1999/xhtml"
         xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
-        onwizardfinish="return onFinish();"
         onload="initWizard();"
         style="&window.size;">
   <script type="application/javascript"
           src="chrome://global/content/customElements.js"/>
 
   <stringbundle id="bundle_profileManager"
                 src="chrome://mozapps/locale/profile/profileSelection.properties"/>
 
   <script type="application/javascript" src="chrome://mozapps/content/profile/createProfileWizard.js"/>
 
-  <wizardpage id="explanation" onpageshow="enableNextButton();">
+  <wizardpage id="explanation">
     <description>&profileCreationExplanation_1.text;</description>
     <description>&profileCreationExplanation_2.text;</description>
     <description>&profileCreationExplanation_3.text;</description>
     <spacer flex="1"/>
 #ifdef XP_MACOSX
     <description>&profileCreationExplanation_4Mac.text;</description>
 #else
 #ifdef XP_UNIX
     <description>&profileCreationExplanation_4Gnome.text;</description>
 #else
     <description>&profileCreationExplanation_4.text;</description>
 #endif
 #endif
   </wizardpage>
 
-  <wizardpage id="createProfile" onpageshow="initSecondWizardPage();">
+  <wizardpage id="createProfile">
     <description>&profileCreationIntro.text;</description> 
 
     <label accesskey="&profilePrompt.accesskey;" control="ProfileName">&profilePrompt.label;</label> 
     <textbox id="profileName" value="&profileDefaultName;"
              oninput="updateProfileName(this.value);"/>
     
     <separator/>