Closed Bug 1443079 Opened 7 years ago Closed 7 years ago

nsScriptError.isFromPrivateWindow is always false

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla61
Tracking Status
firefox60 --- wontfix
firefox61 --- fixed

People

(Reporter: nchevobbe, Assigned: baku)

References

Details

Attachments

(1 file, 1 obsolete file)

**Steps to reproduce** 1. Open a private window 2. Navigate to https://nchevobbe.github.io/demo/console-test-app.html 3. Open the browser console 4. Hit the "Exception" button **Expected results** In [1] pageError.isFromPrivateWindow is true **Actual results** In [1]. pageError.isFromPrivateWindow is false --- As far as I understand it, isFromPrivateWindow is set in [2], and I don't think there's a test covering the correctness of this attribute. [1] https://searchfox.org/mozilla-central/rev/d2b4b40901c15614fad2fa34718eea428774306e/devtools/server/actors/webconsole.js#1624 [2] https://searchfox.org/mozilla-central/rev/d2b4b40901c15614fad2fa34718eea428774306e/dom/bindings/nsScriptError.cpp#78-79
Blocks: 1307928
No longer blocks: 1307928
Blocks: 1403188
I think you're the last person making changes to those lines. Would you know what's happening here ?
Flags: needinfo?(bent.mozilla)
baku is just changing some related code in some other bug.
Flags: needinfo?(amarchesini)
Flags: needinfo?(bent.mozilla)
> [1] > https://searchfox.org/mozilla-central/rev/ > d2b4b40901c15614fad2fa34718eea428774306e/devtools/server/actors/webconsole. > js#1624 This is not triggered by the STR.
Assignee: nobody → amarchesini
Flags: needinfo?(amarchesini)
Attached patch scriptError.patch (obsolete) — Splinter Review
Attachment #8956838 - Flags: review?(bugs)
Comment on attachment 8956838 [details] [diff] [review] scriptError.patch >@@ -4151,17 +4151,18 @@ nsContentUtils::LogSimpleConsoleError(co > nsCOMPtr<nsIScriptError> scriptError = > do_CreateInstance(NS_SCRIPTERROR_CONTRACTID); > if (scriptError) { > nsCOMPtr<nsIConsoleService> console = > do_GetService(NS_CONSOLESERVICE_CONTRACTID); > if (console && NS_SUCCEEDED(scriptError->Init(aErrorText, EmptyString(), > EmptyString(), 0, 0, > nsIScriptError::errorFlag, >- classification))) { >+ classification, >+ false /* from private window */))) { Why is this right? This code sure can be called from a private window >+++ b/dom/indexedDB/ScriptErrorHelper.cpp >@@ -138,17 +138,18 @@ public: > } else { > MOZ_ALWAYS_SUCCEEDS( > scriptError->Init(aMessage, > aFilename, > /* aSourceLine */ EmptyString(), > aLineNumber, > aColumnNumber, > aSeverityFlag, >- category.get())); >+ category.get(), >+ /* from private window */ false)); Why false? >+++ b/dom/websocket/WebSocket.cpp >@@ -385,17 +385,18 @@ WebSocketImpl::PrintErrorOnConsole(const > EmptyString(), mScriptLine, > mScriptColumn, > nsIScriptError::errorFlag, "Web Socket", > mInnerWindowID); > } else { > rv = errorObject->Init(message, > NS_ConvertUTF8toUTF16(mScriptFile), > EmptyString(), mScriptLine, mScriptColumn, >- nsIScriptError::errorFlag, "Web Socket"); >+ nsIScriptError::errorFlag, "Web Socket", >+ false /* from private window */); Why false? >+++ b/netwerk/protocol/http/nsCORSListenerProxy.cpp >@@ -1593,16 +1593,17 @@ nsCORSListenerProxy::LogBlockedCORSReque > } > else { > rv = scriptError->Init(aMessage, > EmptyString(), // sourceName > EmptyString(), // sourceLine > 0, // lineNumber > 0, // columnNumber > nsIScriptError::warningFlag, >- "CORS"); >+ "CORS", >+ false); // Private Window why false?
Attachment #8956838 - Flags: review?(bugs) → review-
Attachment #8956838 - Attachment is obsolete: true
Attachment #8958072 - Flags: review?(bugs)
Attachment #8958072 - Flags: review?(bugs) → review+
Pushed by amarchesini@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/47a89fa7cfd2 nsScriptError.isFromPrivateWindow must match the correct value also in e10s mode, r=smaug
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla61
Depends on: 1447422
QA Whiteboard: [good first verify]
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: