Bug 1274390 - Include isPrivate and desktopMode in the session store data used for initialising new tabs. r=sebastian, a=ritu
authorJan Henning <jh+bugzilla@buttercookie.de>
Sat, 21 May 2016 19:41:07 +0200
changeset 333015 b01ee9309ba0d1d2ac65e4f2d8e25899ca817ec4
parent 333014 80c89a78cae57e319a7b27b30b26200064b351d5
child 333016 12f53b845cb9843dbcfa4431d3aa2d12a824c878
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssebastian, ritu
bugs1274390
milestone48.0a2
Bug 1274390 - Include isPrivate and desktopMode in the session store data used for initialising new tabs. r=sebastian, a=ritu Restoring a tab from the Recent Tabs panel, which goes via the session store's _restoreTabs() function and ultimately via BrowserApp.addTab() and a Tab:Added message back to the Java UI requires the value for isPrivate to be present in the session store data for the respective tab - if it isn't, we end up sending isPrivate as "undefined", which breaks the process of adding the new tab in our UI. When the session store collects the full tab data for a browser, it always includes the values for isPrivate and desktopMode, therefore we now include those values in the basic session store data we use in initialising a new tab object, too. MozReview-Commit-ID: 5BZ9PL7xDWA
mobile/android/chrome/content/browser.js
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -3490,17 +3490,19 @@ Tab.prototype = {
 
     // Always intialise new tabs with basic session store data to avoid
     // problems with functions that always expect it to be present
     this.browser.__SS_data = {
       entries: [{
         url: aURL,
         title: truncate(title, MAX_TITLE_LENGTH)
       }],
-      index: 1
+      index: 1,
+      desktopMode: this.desktopMode,
+      isPrivate: isPrivate
     };
 
     if (aParams.delayLoad) {
       // If this is a zombie tab, mark the browser for delay loading, which will
       // restore the tab when selected using the session data added above
       this.browser.__SS_restore = true;
     } else {
       let flags = "flags" in aParams ? aParams.flags : Ci.nsIWebNavigation.LOAD_FLAGS_NONE;