Closed Bug 1719156 Opened 3 years ago Closed 3 years ago

Iframe dropdown is always empty when using server side targets

Categories

(DevTools :: Framework, defect)

defect

Tracking

(Fission Milestone:MVP, firefox92 fixed)

RESOLVED FIXED
92 Branch
Fission Milestone MVP
Tracking Status
firefox92 --- fixed

People

(Reporter: ochameau, Assigned: nchevobbe)

References

Details

(Whiteboard: dt-fission-m3-mvp)

Attachments

(1 file)

When enabling server side target switching devtools.target-switching.server.enabled=true, the iframe dropdown misbehaves. It no longer live updates because of doNotFireFrameUpdates: true flag we set on all server side targets:
https://searchfox.org/mozilla-central/search?q=doNotFireFrameUpdates&path=&case=true&regexp=false
It is then only updated once, on target switching:
https://searchfox.org/mozilla-central/source/devtools/client/framework/toolbox.js#731

It was probably not the right call to disable these events and we should try to enable them again for server side targets, but only for top level targets.
We may also benefit from using resources. But it may rather be worth trying to reimplement the iframe dropdown to be based on top of targets + TargetCommand + target switching rather than the hack on BrowsingContextTargetActor.

Whiteboard: dt-fission-m3-triage
Whiteboard: dt-fission-m3-triage → dt-fission-m3-mvp
Fission Milestone: --- → MVP

The iframe dropdown works if you open the toolbox against an already loaded page.
And in this bug we consider that fission is disabled. The dropdown is known to be broken for OOP iframe and that's another quest (bug 1608054).
With server targets, the iframe dropdown no longer works correctly for same-process iframes, so even when fission is off.

STR:

  • Open DevTools
  • Load http://techno-barje.fr/fission/wiki-n-ubuntu/
  • Open DevTools
    [* if you use the iframe drop down, it will work correctly here]
  • Reload the page
  • If you use the iframe dropdown, it won't work and you will have the following exception:
console.error: "Error while calling actor 'frameTarget's method 'switchToFrame'" "The related docshell is destroyed or not found"
JavaScript error: resource://devtools/shared/protocol/Front.js, line 362: Error: Protocol error (noWindow): The related docshell is destroyed or not found from: server0.conn1.windowGlobal4294967309/frameTarget1

https://searchfox.org/mozilla-central/rev/352b525ab841278cd9b3098343f655ef85933544/devtools/server/actors/targets/browsing-context.js#726

This is most likely related to this disabling:
https://searchfox.org/mozilla-central/rev/352b525ab841278cd9b3098343f655ef85933544/devtools/server/connectors/js-window-actor/DevToolsFrameChild.jsm#346
which prevents correctly updating the iframe drop down with the right outerWindowIDs.

This bug is a soft blocker for Fission MVP. We'd like to fix it before our Release channel rollout, but we won't delay the rollout waiting for it.

Whiteboard: dt-fission-m3-mvp → dt-fission-m3-mvp, fission-soft-blocker

We used to set doNotFireFrameUpdates on all the target actors
created from the server, and as a result, we would never populate
the iframe dropdown.
The original concern was that since we can have multiple targets
now (when fission is enabled), different frameUpdate events would
be fired which would cause issues in the iframe dropdown.
But at the moment, we know that the iframe dropdown does not support
Fission (remote frames are not displayed), as the toolbox only listen
for frame-update events emitted from the top-level target.
With this patch, we'll emit frameUpdate event only from top-level targets,
so we don't send unnecessary RDP packet to client.
A test is added that checks multiple scenarios with pages adding and
removing iframes, as well as navigating so we can assert the dropdown
berhaviour with server side targets.
The test is tagged as fail-if on Fission as we're missing remote frames
in the dropdown.

Assignee: nobody → nchevobbe
Status: NEW → ASSIGNED
Pushed by nchevobbe@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/4022459dae76 [devtools] Fix iframe dropdown with server side target. r=jdescottes.
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 92 Branch
Whiteboard: dt-fission-m3-mvp, fission-soft-blocker → dt-fission-m3-mvp
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: