Skip to content

Commit

Permalink
Correctly "toggle" private state of first (and non-remote) tab
Browse files Browse the repository at this point in the history
  • Loading branch information
Infocatcher committed Jan 18, 2017
1 parent ee1a000 commit 000ca2d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -3620,9 +3620,11 @@ var privateTab = {
onFirstPrivateTab: function(window, tab) {
this.onFirstPrivateTab = function() {};
_log("First private tab");
window.setTimeout(function() {
this.ss.persistTabAttribute(this.privateAttr);
}.bind(this), 0);
window.setTimeout(this.persistPrivateAttribute.bind(this), 0);
},
persistPrivateAttribute: function() {
this.persistPrivateAttribute = function() {};
this.ss.persistTabAttribute(this.privateAttr);
},
fixTabState: function(tab, isPrivate) {
if(!this.isPendingTab(tab) || !prefs.get("workaroundForPendingTabs"))
Expand Down Expand Up @@ -3736,6 +3738,7 @@ var privateTab = {
var gBrowser = this.getTabBrowser(tab);
if(isPrivate === undefined)
isPrivate = !this.isPrivateTab(tab); // Toggle
isPrivate && this.persistPrivateAttribute();
// Simplest way to get correct session state for duplicated tab
var origIsPrivate = tab.hasAttribute(this.privateAttr);
if(isPrivate)
Expand Down

0 comments on commit 000ca2d

Please sign in to comment.