Blank screen when trying to inspect a tab or enter multi-process
Categories
(DevTools :: about:debugging, defect, P2)
Tracking
(firefox137 fixed)
| Tracking | Status | |
|---|---|---|
| firefox137 | --- | fixed |
People
(Reporter: matt-tighe, Assigned: ochameau, NeedInfo)
References
Details
Attachments
(3 files)
What were you doing?
I am trying to use the remote debugging tool through desktop Nightly to debug tabs running on my local Android development build.
- Enable developer mode on Android device
- Enable USB debugging on Android device
- Build and run Fenix
- Access Fenix settings and enable "Remote debugging via USB"
- go to about:debugging on desktop
- Connect to Android device
- Click "Inspect" on an active tab or the multi-process toolbox
What happened?
A new tab is opened with a url like about:devtools-toolbox?type=tab&id=7&remoteId=adb-3712105H809P4Q-x5rLMg._adb-tls-connect._tcp%257C%2540org.mozilla.fenix.debug%252Ffirefox-debugger-socket-usb, but the tab is blank. Screenshot attached.
What should have happened?
The tooling appears
| Reporter | ||
Comment 1•1 year ago
|
||
Comment 2•1 year ago
|
||
Thanks for filing, we could not reproduce the issue for now. Could you try to check the Browser Console logs on your desktop Nightly (Tools > Browser Tools > Browser Console), as well as the adb logs when trying to open the toolbox? Maybe there is something devtools related there.
Thanks
| Assignee | ||
Comment 3•1 year ago
|
||
I'm able to reproduce when connecting to 134 with the following exception:
console.log: "Request to connect to ProcessDescriptor \"0\" failed: Error: Protocol error (TypeError): can't access property \"docShell\", window is null from: server0.conn0.processDescriptor16 (resource://devtools/server/actors/targets/parent-process.js:112:5)"
console.error: "Exception while opening the toolbox" "TypeError: can't access property \"setTargetType\", this.targetFront is null" (new TypeError("can't access property \"setTargetType\", this.targetFront is null", "resource://devtools/shared/commands/target/target-command.js", 547))
_createFirstTarget@resource://devtools/shared/commands/target/target-command.js:547:5
| Assignee | ||
Comment 4•1 year ago
|
||
Once you hit that issue, you have to restart firefox, or you would also get the following error when debugging a tab:
console.error: "Exception while opening the toolbox" "Error: Protocol error (TypeError): can't access property \"startsWith\", actor.actorID is null from: server0.conn0.watcher51 (resource://devtools/server/actors/targets/target-actor-registry.sys.mjs:50:32)" (new Error("Protocol error (TypeError): can't access property \"startsWith\", actor.actorID is null from: server0.conn0.watcher51 (resource://devtools/server/actors/targets/target-actor-registry.sys.mjs:50:32)", "resource://devtools/shared/protocol/Front.js", 382))
onPacket/<@resource://devtools/shared/protocol/Front.js:382:31
DevTools RDP*request@resource://devtools/shared/protocol/Front.js:299:14
generateRequestMethods/</frontProto[name]@resource://devtools/shared/protocol/Front/FrontClassWithSpec.js:47:19
_startListening@resource://devtools/shared/commands/resource/resource-command.js:1047:31
Comment 3 exception seems to only reproduce when you have no tab opened at all.
It looks like fenix doesn't spawn any document in the parent process when there is no tab opened.
Matt, could you confirm this breaks only when the android browser has no tab opened? (you may only have the firefox default tab showing your recent tabs and visit)
| Reporter | ||
Comment 5•1 year ago
|
||
Yes, it does appear that the broken state is reached when trying to enter multi-process inspection with no tab open, and that restarting desktop Firefox is the only way to exit the broken state. I got the same error as the one you listed above.
It would be great if there were a simpler way to reset the broken state, like by simply closing multi-process mode, opening a tab in Fenix, and then returning to multi-process mode. Or, perhaps we could disable the multi-process inspect button while no tabs are open? Either way, I can at least prevent the issue in my own usage moving forward. Thanks for the help!
Comment 6•1 year ago
|
||
Let's try to add a fallback document in case nothing is available on the Device, at least we will have access to debugger/console.
| Assignee | ||
Comment 7•1 year ago
|
||
It should be something to do around there:
https://searchfox.org/mozilla-central/rev/fb8a1b0beee7dbc1b0a35050ec5c0345f0b09173/devtools/server/actors/targets/parent-process.js#85-100
We might reuse the logic from web extension:
https://searchfox.org/mozilla-central/rev/fb8a1b0beee7dbc1b0a35050ec5c0345f0b09173/devtools/server/actors/descriptors/webextension.js#171-205
But that's actually quite convoluted to retrieve a window in order to later create a browser element.
We may actually rather use a window-less browser:
https://searchfox.org/mozilla-central/rev/fb8a1b0beee7dbc1b0a35050ec5c0345f0b09173/toolkit/components/extensions/ExtensionParent.sys.mjs#1430
and either return its window object, for probably an about:blank document. Or load a custom fallback document to show something useful in the inspector.
| Assignee | ||
Comment 8•11 months ago
|
||
When there is no tab opened, there is no active document running in the parent process.
But DevTools at least expect one to be functional. On desktop it is browser.xhtml.
Updated•10 months ago
|
Comment 10•10 months ago
|
||
Comment 11•10 months ago
|
||
| bugherder | ||
Description
•