From afbe4a8b2feb870c1dc2dee22111f67bf5db9717 Mon Sep 17 00:00:00 2001 From: Infocatcher Date: Thu, 3 Mar 2016 14:06:00 +0300 Subject: [PATCH] Avoid CPOWs in isPrivateContent() (#208) --- bootstrap.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/bootstrap.js b/bootstrap.js index ca91742..8de116d 100644 --- a/bootstrap.js +++ b/bootstrap.js @@ -4126,17 +4126,15 @@ var privateTab = { return window && PrivateBrowsingUtils._privateTabOrigIsWindowPrivate(window); }, isPrivateContent: function(window) { - try { + var tab = window.gBrowser.selectedTab; + if(!this.isRemoteTab(tab)) try { return this.isPrivateWindow(this.getContentWindow(window)); } catch(e) { - _log( - "isPrivateContent() failed. Electrolysis? Fallback to check private attribute" - + (_dbgv ? ". Call stack:\n" + new Error().stack : "") - ); - _dbgv && Components.utils.reportError(e); + _log("isPrivateContent() failed, call stack:\n" + new Error().stack); + Components.utils.reportError(e); } - return window.gBrowser.selectedTab.hasAttribute(this.privateAttr); + return tab.hasAttribute(this.privateAttr); }, getContentWindow: function(window) { // Note: with enabled Electrolysis window.content may refers to