Closed Bug 1931651 Opened 1 year ago Closed 10 months ago

Blank screen when trying to inspect a tab or enter multi-process

Categories

(DevTools :: about:debugging, defect, P2)

defect

Tracking

(firefox137 fixed)

RESOLVED FIXED
137 Branch
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.

  1. Enable developer mode on Android device
  2. Enable USB debugging on Android device
  3. Build and run Fenix
  4. Access Fenix settings and enable "Remote debugging via USB"
  5. go to about:debugging on desktop
  6. Connect to Android device
  7. 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

Attached file about:support report

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

Flags: needinfo?(mtighe)

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

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)

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!

Flags: needinfo?(mtighe)

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.

Severity: -- → S3
Flags: needinfo?(jdescottes)
Priority: -- → P2

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.

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.

Assignee: nobody → poirot.alex
Status: NEW → ASSIGNED
Duplicate of this bug: 1947657
Pushed by apoirot@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/47249a9d2353 [devtools] Use a fallback document when there is no available document on Fenix. r=devtools-reviewers,nchevobbe
Status: ASSIGNED → RESOLVED
Closed: 10 months ago
Resolution: --- → FIXED
Target Milestone: --- → 137 Branch
Regressions: 1949958
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: