Bug 743415 - Back button goes back to about:empty after leading a redirect [r=mfinkle]
authorMatt Brubeck <mbrubeck@mozilla.com>
Wed, 11 Apr 2012 09:10:38 -0700
changeset 94748 305e5980de923618abda73d6ea3d86b1779b1395
parent 94747 ed7531e3906623539ba95963ab9c3d17082ab1bb
child 94749 8eb50850371c79546b6e7fb514f5659753c1dfee
push id886
push userlsblakk@mozilla.com
push dateMon, 04 Jun 2012 19:57:52 +0000
treeherdermozilla-beta@bbd8d5efd6d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs743415
milestone14.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 743415 - Back button goes back to about:empty after leading a redirect [r=mfinkle]
mobile/android/chrome/content/browser.js
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -244,29 +244,33 @@ var BrowserApp = {
     WebappsUI.init();
     RemoteDebugger.init();
 
     // Init LoginManager
     Cc["@mozilla.org/login-manager;1"].getService(Ci.nsILoginManager);
     // Init FormHistory
     Cc["@mozilla.org/satchel/form-history;1"].getService(Ci.nsIFormHistory2);
 
+    let loadParams = {};
     let url = "about:home";
     let forceRestore = false;
     if ("arguments" in window) {
       if (window.arguments[0])
         url = window.arguments[0];
       if (window.arguments[1])
         forceRestore = window.arguments[1];
       if (window.arguments[2])
         gScreenWidth = window.arguments[2];
       if (window.arguments[3])
         gScreenHeight = window.arguments[3];
     }
 
+    if (url == "about:empty")
+      loadParams.flags = Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_HISTORY;
+
     // XXX maybe we don't do this if the launch was kicked off from external
     Services.io.offline = false;
 
     // Broadcast a UIReady message so add-ons know we are finished with startup
     let event = document.createEvent("Events");
     event.initEvent("UIReady", true, false);
     window.dispatchEvent(event);
 
@@ -279,17 +283,17 @@ var BrowserApp = {
       sendMessageToJava({
         gecko: {
           type: "Session:RestoreBegin"
         }
       });
 
       // Open any commandline URLs, except the homepage
       if (url && url != "about:home") {
-        this.addTab(url);
+        this.addTab(url, loadParams);
       } else {
         // Let the session make a restored tab active
         restoreToFront = true;
       }
 
       // Be ready to handle any restore failures by making sure we have a valid tab opened
       let restoreCleanup = {
         observe: function(aSubject, aTopic, aData) {
@@ -308,17 +312,18 @@ var BrowserApp = {
           });
         }
       };
       Services.obs.addObserver(restoreCleanup, "sessionstore-windows-restored", false);
 
       // Start the restore
       ss.restoreLastSession(restoreToFront, forceRestore);
     } else {
-      this.addTab(url, { showProgress: url != "about:home" });
+      loadParams.showProgress = (url != "about:home");
+      this.addTab(url, loadParams);
 
       // show telemetry door hanger if we aren't restoring a session
       this._showTelemetryPrompt();
     }
 
     if (this.isAppUpdated())
       this.onAppUpdated();