Bug 593683 - Small fixes in tabbed browser: also treat about:sessionrestore as initial page. r=Neil, sr=Neil
authorMisak Khachatryan <misak.bugzilla@gmail.com>
Fri, 24 Sep 2010 13:19:29 +0500
changeset 6422 4d36594ea0e87798e4d4e7737c5b489b96229eba
parent 6421 ae798bbc39654b825d4de4c789e7bcaeabca1818
child 6423 a2d109f74af37e5b5472366dacee8f457deaad17
push id4959
push userphilip.chee@gmail.com
push dateFri, 24 Sep 2010 16:04:30 +0000
treeherdercomm-central@4d36594ea0e8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersNeil, Neil
bugs593683
Bug 593683 - Small fixes in tabbed browser: also treat about:sessionrestore as initial page. r=Neil, sr=Neil Bad merge from http://hg.mozilla.org/comm-central/rev/ae798bbc3965 reapplying!
suite/browser/navigator.js
--- a/suite/browser/navigator.js
+++ b/suite/browser/navigator.js
@@ -64,16 +64,21 @@ var gLastValidURLStr = "";
 var gLastValidURL = null;
 var gClickSelectsAll = false;
 var gClickAtEndSelects = false;
 var gIgnoreFocus = false;
 var gIgnoreClick = false;
 var gURIFixup = null;
 var gThemes = [];
 
+var gInitialPages = [
+  "about:blank",
+  "about:sessionrestore"
+];
+
 //cached elements
 var gBrowser = null;
 
 function ReloadThemes()
 {
   AddonManager.getAddonsByTypes(["theme"], function(themes) {
     gThemes = themes.sort(function(a, b) {
       return a.name.localeCompare(b.name);
@@ -1860,18 +1865,18 @@ function URLBarSetURI(aURI, aValid) {
     gURIFixup = Components.classes["@mozilla.org/docshell/urifixup;1"]
                           .getService(Components.interfaces.nsIURIFixup);
   try {
     uri = gURIFixup.createExposableURI(uri);
   } catch (ex) {}
 
   // Replace "about:blank" with an empty string
   // only if there's no opener (bug 370555).
-  if (uri.spec == "about:blank")
-    value = content.opener || getWebNavigation().canGoBack ? "about:blank" : "";
+  if (gInitialPages.indexOf(uri.spec) != -1)
+    value = (content.opener || getWebNavigation().canGoBack) ? uri.spec : "";
   else
     value = losslessDecodeURI(uri);
 
   gURLBar.value = value;
   // In some cases, setting the urlBar value causes userTypedValue to
   // become set because of oninput, so reset it to null.
   getBrowser().userTypedValue = null;