Closed Bug 1659376 Opened 1 year ago Closed 1 year ago

Browser toolbox doesn't work with the new print preview UI

Categories

(DevTools :: Inspector, defect)

defect

Tracking

(firefox82 verified, firefox83 verified)

VERIFIED FIXED
82 Branch
Tracking Status
firefox82 --- verified
firefox83 --- verified

People

(Reporter: hiro, Assigned: nchevobbe)

References

(Blocks 2 open bugs)

Details

(Whiteboard: [print2020_v81])

Attachments

(2 files)

STR;

  1. Open the new print preview
  2. Open the browser toolbox

That's a weird one…

Whiteboard: [print2020_v81]

Nicolas, would you have any idea what's going on here? The console and debugger seem fine, but the inspector is upset (blank) for some reason.

Component: Printing → Inspector
Flags: needinfo?(nchevobbe)
Product: Toolkit → DevTools

So, while opening the Browser Toolbox, there's no specific error, it just seems to wait for ever.
When I closed it, I was able to get that stack:

JavaScript error: resource://devtools/shared/protocol/Front.js, line 77: Error: Connection closed, pending request to server4.conn0.windowGlobal4294967300/inspectorActor3, type getHighlighter failed

Request stack:
request@resource://devtools/shared/protocol/Front.js:260:14
generateRequestMethods/</frontProto[name]@resource://devtools/shared/protocol/Front/FrontClassWithSpec.js:46:19
_getHighlighter@resource://devtools/client/fronts/inspector.js:70:35
initialize@resource://devtools/client/fronts/inspector.js:44:12
manage@resource://devtools/shared/protocol/Front.js:120:19
getFront@resource://devtools/shared/protocol/types.js:609:18
getFront@resource://devtools/client/fronts/targets/target-mixin.js:328:15
module.exports@resource://devtools/shared/resources/legacy-listeners/root-node.js:51:44
_watchResourcesForTarget@resource://devtools/shared/resources/resource-watcher.js:475:41
_startListening@resource://devtools/shared/resources/resource-watcher.js:450:26
watchResources@resource://devtools/shared/resources/resource-watcher.js:115:20

It looked like we were waiting on the getHighlighter method.
With my best dump abilities, I traced it back to https://searchfox.org/mozilla-central/rev/fa7f47027917a186fb2052dee104cd06c21dd76f/devtools/server/actors/highlighters.js#127-130
Here, readyState equals to "uninitialized" for the about:printpreview document , so we don't resolve the Promise we're waiting on (we're waiting for a "navigate" event that won't come).

I don't know if it's a regular state for this document?

CC'ing Razvan as he knows this part of the code way better than I do

Flags: needinfo?(nchevobbe)
Assignee: nobody → nchevobbe
Status: NEW → ASSIGNED

The issue was that the getHighlighter request for the about:printpreview
target never settled. It appears that the document always stays in an
unitialized readyState, which was causing trouble.
Instead of relying only on readyState, we now call isDocumentReady, which
also checks if the document is loading.

Depends on D87755

Pushed by nchevobbe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/86e77b35c75d
Extract isDocumentReady from WalkerActor to inspector utils file. r=rcaliman.
https://hg.mozilla.org/integration/autoland/rev/61e3dea03a62
Fix Browser Toolbox inspector when print preview is displayed.r=rcaliman.

(In reply to Narcis Beleuzu [:NarcisB] from comment #7)

Backed out for dt failures on browser_dbg-content-script-sources.js

Backout link: https://hg.mozilla.org/integration/autoland/rev/432e42cbbc4139efd2319952ec33efe8ff9add3c
Log link: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=313673751&repo=autoland&lineNumber=22878

I'll investigate

Flags: needinfo?(nchevobbe)
Pushed by nchevobbe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/67abf3def9a6
Extract isDocumentReady from WalkerActor to inspector utils file. r=rcaliman.
https://hg.mozilla.org/integration/autoland/rev/d4727eb42233
Fix Browser Toolbox inspector when print preview is displayed.r=rcaliman.
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 82 Branch
See Also: → 1661627

Hello I have managed to reproduce the issue following using firefox Nightly 81.0a1(2020-08-15) on Windows.
I can confirm that the issue is fixed on firefox 82.0b2 and 83.0a1(2020-09-25) on all OS platforms.

Status: RESOLVED → VERIFIED
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.