Bug 1274390 - Include isPrivate and desktopMode in the session store data used for initialising new tabs. r=sebastian draft
authorJan Henning <jh+bugzilla@buttercookie.de>
Sat, 21 May 2016 19:41:07 +0200
changeset 369294 018be71a7367ffd8dc07214c79f49a3951b9004f
parent 369293 39e79048e4d25a4d79d28bf19728a249c379528d
child 521544 2780885d90a8232bbd8bced55b8d6d2240f67375
push id18830
push usermozilla@buttercookie.de
push dateSat, 21 May 2016 18:46:32 +0000
reviewerssebastian
bugs1274390
milestone49.0a1
Bug 1274390 - Include isPrivate and desktopMode in the session store data used for initialising new tabs. r=sebastian 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
@@ -3527,17 +3527,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;