Bug 818224 - Show all chrome script errors originated from private windows; r=bholley a=akeybl
authorEhsan Akhgari <ehsan@mozilla.com>
Mon, 14 Jan 2013 09:17:37 -0500
changeset 127127 6d10f02d540ef390489c04df9471de24635989cc
parent 127126 a34152bf0975b57999ed61894f5f5391456ff9cf
child 127128 9424fc1b16c6dda6228292e40c66e0546596be6c
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbholley, akeybl
bugs818224
milestone20.0a2
Bug 818224 - Show all chrome script errors originated from private windows; r=bholley a=akeybl
js/xpconnect/src/nsScriptError.cpp
--- a/js/xpconnect/src/nsScriptError.cpp
+++ b/js/xpconnect/src/nsScriptError.cpp
@@ -132,17 +132,19 @@ nsScriptError::InitWithWindowID(const ns
         if (window) {
             nsPIDOMWindow* outer = window->GetOuterWindow();
             if (outer)
                 mOuterWindowID = outer->WindowID();
 
             nsIDocShell* docShell = window->GetDocShell();
             nsCOMPtr<nsILoadContext> loadContext = do_QueryInterface(docShell);
             if (loadContext) {
-              mIsFromPrivateWindow = loadContext->UsePrivateBrowsing();
+              // Never suppress errors originated from chrome code
+              mIsFromPrivateWindow = !nsContentUtils::IsCallerChrome() &&
+                                     loadContext->UsePrivateBrowsing();
             }
         }
     }
 
     return NS_OK;
 }
 
 NS_IMETHODIMP