Closed Bug 1273311 Opened 8 years ago Closed 8 years ago

Debugger shows an error "newChannel does not accept 'loadUsingSystemPrincipal' if the 'loadingNode' or 'loadingPrincipal' properties are present on the options object."

Categories

(DevTools :: Debugger, defect, P1)

defect

Tracking

(firefox49 verified)

VERIFIED FIXED
Firefox 49
Tracking Status
firefox49 --- verified

People

(Reporter: simon.lindholm10, Assigned: ochameau)

References

Details

Attachments

(1 file)

Go to http://simonsoftware.se/other/justatextarea.html, enter > <script>a = 1;</script> into the text field, and press Modify HTML (which will do document.open, document.write(that text), document.close). Then open the Debugger. I'm seeing the following error appear in the source view: > Error loading this URL: Could not load the source for http://simonsoftware.se/other/justatextarea.html. > [Exception... "newChannel does not accept 'loadUsingSystemPrincipal' if the 'loadingNode' or 'loadingPrincipal' properties are present on the options object." nsresult: "0x80070057 (NS_ERROR_ILLEGAL_VALUE)" location: "JS frame :: resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/DevToolsUtils.js :: newChannelForURL :: line 557" data: no] > Stack: newChannelForURL@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/DevToolsUtils.js:557:12 > mainThreadFetch@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/DevToolsUtils.js:413:15 > SourceActor<._getSourceText/<@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/server/actors/source.js:378:29 > Handler.prototype.process@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:937:23 > this.PromiseWalker.walkerLoop@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:816:7 > Promise*this.PromiseWalker.scheduleWalkerLoop@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:747:11 > this.PromiseWalker.schedulePromise@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:779:7 > Promise.prototype.then@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:454:5 > SourceActor<.onSource<@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/server/actors/source.js:457:12 > generateRequestHandlers/</handler@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/protocol.js:1046:19 > DSC_onPacket@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/server/main.js:1643:15 > ChildDebuggerTransport.prototype.receiveMessage@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/transport/transport.js:742:5 > Line: 557, column: 0 and that error message sounds valid; DevToolsUtils.js's newChannelForURL is indeed passing both loadUsingSystemPrincipal and loadingPrincipal to newChannel when it has a principal. (I don't know whether the debugger is meant to be able to fetch sources despite document.open(), but that seems secondary to this error in any case.) Blame points to bug 1060732.
:ochameau, can you take a look since you worked on bug 1060732?
Flags: needinfo?(poirot.alex)
Priority: -- → P1
Thanks for the very detailed report, I'll look into this!
Assignee: nobody → poirot.alex
Flags: needinfo?(poirot.alex)
Attached patch patch v1Splinter Review
I don't get why that doesn't throw in other cases. But here is a fix for that. Thanks again Simon for your really helpful report!
Comment on attachment 8755824 [details] [diff] [review] patch v1 Review of attachment 8755824 [details] [diff] [review]: ----------------------------------------------------------------- Eddy, here is a small patch to fix a regression from bug 1060732.
Attachment #8755824 - Flags: review?(ejpbruel)
Comment on attachment 8755824 [details] [diff] [review] patch v1 Review of attachment 8755824 [details] [diff] [review]: ----------------------------------------------------------------- LGTM. I took a day off on friday and monday, hence the slow review turnover.
Attachment #8755824 - Flags: review?(ejpbruel) → review+
https://hg.mozilla.org/integration/fx-team/rev/8bf67bdad00282eed87c14a08c166a0ca90bf621 Bug 1273311 - Prevent DevToolsUtils.fetch from throwing when no policy is given. r=ejpbruel
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 49
I have reproduced this bug with Nightly 49.0a1 (2016-05-16) on Windows 7 ,64Bit! This bug's fix is verified on latest Developer Edition Build ID 20160708004052 User Agent Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:49.0) Gecko/20100101 Firefox/49.0 Build ID 20160714030208 User Agent Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:50.0) Gecko/20100101 Firefox/50.0
(In reply to Maruf Rahman from comment #9) > I have reproduced this bug with Nightly 49.0a1 (2016-05-16) on Windows 7 > ,64Bit! > > This bug's fix is verified on latest Developer Edition > > Build ID 20160708004052 > User Agent Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:49.0) Gecko/20100101 > Firefox/49.0 > > Build ID 20160714030208 > User Agent Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:50.0) Gecko/20100101 > Firefox/50.0 And its also been fixed in latest Nightly(Representing the last 2 lines of the comment number 09)
Thanks for testing Maruf! I also verified this using latest DevEdition 49.0a2 on Mac OS X 10.10.5.
Status: RESOLVED → VERIFIED
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: