diff --git a/services/cloudsync/CloudSyncTabs.jsm b/services/cloudsync/CloudSyncTabs.jsm index b0921b709bc..ba9077999b0 100644 --- a/services/cloudsync/CloudSyncTabs.jsm +++ b/services/cloudsync/CloudSyncTabs.jsm @@ -148,8 +148,7 @@ this.Tabs = function () { let update = function (event) { if (event.originalTarget.linkedBrowser) { - let win = event.originalTarget.linkedBrowser.contentWindow; - if (PrivateBrowsingUtils.isWindowPrivate(win) && + if (PrivateBrowsingUtils.isBrowserPrivate(event.originalTarget.linkedBrowser) && !PrivateBrowsingUtils.permanentPrivateBrowsing) { return; } diff --git a/toolkit/modules/PrivateBrowsingUtils.jsm b/toolkit/modules/PrivateBrowsingUtils.jsm index 1c013dcaefd..847160e21b0 100644 --- a/toolkit/modules/PrivateBrowsingUtils.jsm +++ b/toolkit/modules/PrivateBrowsingUtils.jsm @@ -16,10 +16,16 @@ const Cc = Components.classes; const Ci = Components.interfaces; this.PrivateBrowsingUtils = { + // Rather than passing content windows to this function, please use + // isBrowserPrivate since it works with e10s. isWindowPrivate: function pbu_isWindowPrivate(aWindow) { return this.privacyContextFromWindow(aWindow).usePrivateBrowsing; }, + isBrowserPrivate: function(aBrowser) { + return this.isWindowPrivate(aBrowser.ownerDocument.defaultView); + }, + privacyContextFromWindow: function pbu_privacyContextFromWindow(aWindow) { return aWindow.QueryInterface(Ci.nsIInterfaceRequestor) .getInterface(Ci.nsIWebNavigation)