diff --git a/browser/components/nsBrowserGlue.js b/browser/components/nsBrowserGlue.js index aad40f93ffc0..29be07188fa9 100644 --- a/browser/components/nsBrowserGlue.js +++ b/browser/components/nsBrowserGlue.js @@ -24,6 +24,7 @@ # Asaf Romano # Marco Bonardo # Dietrich Ayala +# Ehsan Akhgari # # Alternatively, the contents of this file may be used under the terms of # either the GNU General Public License Version 2 or later (the "GPL"), or @@ -323,7 +324,11 @@ BrowserGlue.prototype = { showPrompt = this._prefs.getBoolPref("browser.tabs.warnOnClose"); } catch (ex) {} - if (!showPrompt) + // Never show a prompt inside the private browsing mode + var inPrivateBrowsing = Cc["@mozilla.org/privatebrowsing;1"]. + getService(Ci.nsIPrivateBrowsingService). + privateBrowsingEnabled; + if (!showPrompt || inPrivateBrowsing) return false; var buttonChoice = 0;