From 99a91a54f0300fa783204ecf6d2f9303fcfd383a Mon Sep 17 00:00:00 2001 From: Infocatcher Date: Fri, 13 Jan 2017 00:27:03 +0300 Subject: [PATCH] Also handle non-remote tabs in "TabRemotenessChange" handler E.g. for restored non-remote tabs (now also used to toggle private state using tag duplication) (#239) --- bootstrap.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/bootstrap.js b/bootstrap.js index 33c4bc5..7077c7e 100644 --- a/bootstrap.js +++ b/bootstrap.js @@ -2235,12 +2235,18 @@ var privateTab = { return; } _log(e.type + ": force make tab " + _p(isPrivate)); - var mm = tab.linkedBrowser.messageManager; - this.sendAsyncMessage(window, mm, { - action: "ToggleState", - isPrivate: isPrivate, - silent: true - }); + if(this.isRemoteTab(tab)) { + var mm = tab.linkedBrowser.messageManager; + this.sendAsyncMessage(window, mm, { + action: "ToggleState", + isPrivate: isPrivate, + silent: true + }); + } + else { + var privacyContext = this.getTabPrivacyContext(tab); + privacyContext.usePrivateBrowsing = isPrivate; + } }, setWindowBusy: function(e, busy) { _log("setWindowBusy(): " + busy);