mozilla / positron

a experimental, Electron-compatible runtime on top of Gecko
Other
568 stars 64 forks source link

BrowserWindow document body empty in Inspector devtool #83

Open mykmelez opened 8 years ago

mykmelez commented 8 years ago

Giving a BrowserWindow the system principal, which I did on the webview-branch (since merged to master), causes the BrowserWindow document body to appear empty in the Inspector devtool's tree view, when I open the Inspector for a given BrowserWindow. And opening the Inspector triggers these errors in the console:

Error writing response to: childrenprotocol.js:1058 TypeError: 'get contentDocument' called on an object that does not implement interface HTMLObjectElement. Stack trace: get numChildren@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/server/actors/inspector.js:352:1 exports.NodeActor<.form@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/server/actors/inspector.js:262:7 types.addActorType/type<.write@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/protocol.js:294:44 types.addArrayType/<.write/<@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/protocol.js:199:40 types.addArrayType/<.write@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/protocol.js:199:24 types.addDictType/<.write@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/protocol.js:233:23 RetVal<.write@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/protocol.js:529:12 Response<.write/<@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/protocol.js:682:16 Response<.write@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/protocol.js:680:23 generateRequestHandlers/</handler/sendReturn@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/protocol.js:1056:24 Handler.prototype.process@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/Promise-backend.js:937:23 this.PromiseWalker.walkerLoop@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/Promise-backend.js:816:7 Promise*this.PromiseWalker.scheduleWalkerLoop@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/Promise-backend.js:747:11 this.PromiseWalker.schedulePromise@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/Promise-backend.js:779:7 Promise.prototype.then@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/Promise-backend.js:454:5 generateRequestHandlers/</handler/<@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/protocol.js:1076:18 Actor<._queueResponse@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/protocol.js:920:20 generateRequestHandlers/</handler@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/protocol.js:1075:9 DSC_onPacket@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/server/main.js:1648:15 LocalDebuggerTransport.prototype.send/<@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/transport/transport.js:568:13 exports.makeInfallible/<@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/ThreadSafeDevToolsUtils.js:101:14 exports.makeInfallible/<@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/ThreadSafeDevToolsUtils.js:101:14 protocol.js:907 Protocol error (unknownError): 'get contentDocument' called on an object that does not implement interface HTMLObjectElement.Promise-backend.js:940

@jryans Perhaps Inspector is not designed to support chrome HTML documents? Or maybe the way we give the system principal to the BrowserWindow document, which isn't at a chrome: URL, is the culprit?

wellington1993 commented 6 years ago

Hi,

I don't know about the project context but I got similar problems:

Handler function DebuggerProgressListener.prototype.onStateChange threw an exception: [Exception... "Component returned failure code: 0x80004002 (NS_NOINTERFACE) [nsIWebProgress.DOMWindow]"  nsresult: "0x80004002 (NS_NOINTERFACE)"  location: "JS frame :: resource://devtools/shared/base-loader.js -> resource://devtools/server/actors/tab.js :: _docShellToWindow :: line 768"  data: no]
Stack: _docShellToWindow@resource://devtools/shared/base-loader.js -> resource://devtools/server/actors/tab.js:768:9
_docShellsToWindows/<@resource://devtools/shared/base-loader.js -> resource://devtools/server/actors/tab.js:792:38
_docShellsToWindows@resource://devtools/shared/base-loader.js -> resource://devtools/server/actors/tab.js:792:12
_notifyDocShellsUpdate@resource://devtools/shared/base-loader.js -> resource://devtools/server/actors/tab.js:796:19
DebuggerProgressListener.prototype.onStateChange<@resource://devtools/shared/base-loader.js -> resource://devtools/server/actors/tab.js:1624:7
exports.makeInfallible/<@resource://devtools/shared/base-loader.js -> resource://devtools/shared/ThreadSafeDevToolsUtils.js:109:14
Line: 768, column: 0 2 ThreadSafeDevToolsUtils.js:88:5
    reportException resource://devtools/shared/ThreadSafeDevToolsUtils.js:88:5
    exports.makeInfallible/< resource://devtools/shared/ThreadSafeDevToolsUtils.js:115:7

From: view-source:resource://devtools/shared/ThreadSafeDevToolsUtils.js

At:

Nome    Firefox
Versão  61.0a1
ID da compilação    20180321102906
Histórico de atualizações   
Canal de atualização    nightly
User Agent  Mozilla/5.0 (X11; Linux x86_64; rv:61.0) Gecko/20100101 Firefox/61.0
OS  Linux 4.15.0-12-generic

Thanks!

jryans commented 6 years ago

For issues with Firefox like this, I would suggest reporting them over here:

https://bugzilla.mozilla.org/enter_bug.cgi?product=Firefox&component=Developer Tools

If you have more details on what you were doing or how to reproduce, that would help a lot!