Closed Bug 1567849 Opened 5 years ago Closed 4 years ago

Allow the context menu to interact with targets

Categories

(DevTools :: Console, task, P1)

task

Tracking

(firefox73 fixed)

RESOLVED FIXED
Firefox 73
Tracking Status
firefox73 --- fixed

People

(Reporter: nchevobbe, Assigned: nchevobbe)

References

(Blocks 2 open bugs)

Details

(Whiteboard: dt-fission-m1)

Attachments

(1 file, 1 obsolete file)

Some context menu entry (e.g. Copy Object), may need to talk to a specific target to achieve their goal. Let's make sure the context menu can interact with targets.

(Might be covered by Bug 1567836)

Priority: P3 → P2

In the case of Copy Object , this is definitely biting us.
What's done is that from the context menu, we request an evaluation to the server, with:

webConsoleUI.evaluateJSAsync("copy(_self)", {
  selectedObjectActor: actor,
})

where actor is an actorID.
Then on the server, we have some magic to replace the _self part to the value of selectedObjectActor.
But now, since evaluateJSAsync uses the top-level proxy, the server function can't retrieve the actor, and the function fails.
In such case, we should request the evaluation on the right target, which means we need to have a way to know from which proxy the message was added.

Assignee: nobody → jlaster
Status: NEW → ASSIGNED
Priority: P2 → P1
Depends on: 1581614
Depends on: 1582870

Progress

  • this patch gets storeAsGlobal to evaluate in the correct thread
  • we will need to file a follow up bug for using the selected thread for general evaluations
Depends on: 1579090

To be clear, I think this patch should be done in M1, but it should only allow the client to talk to the right target, that's all (so copy object would work, store as global variable would create the variable in the right context).
Any further interaction that would be needed from a user point of view (e.g. switching to said target when the user stored an object as a global variable), will be handled as part of the context switching project.

This still relies on Bug 1579090.
Jason if you want I can take over since there's still some unassigned debugger bugs for M1.

Thanks. I think you have a clearer idea of what needs to be done.

stealing it then :)

Assignee: jlaster → nchevobbe

When the selectedObjectActor options is passed to the evaluateJSAsync
command in the console, we now try to retrieve the corresponding console
front to send the request to the correct target.
This makes the "Copy Object" context menu entry works in the Browser Console
on content objects.
A test is added to ensure this works as expected.

Depends on D54513

Pushed by nchevobbe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/0b459def3e08
Use ad-hoc console front for calls to evaluateJSAsync with selectedObjectActor. r=jdescottes.
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 73
Whiteboard: dt-fission → dt-fission dt-fission-m1
Attachment #9099423 - Attachment is obsolete: true
Regressions: 1617210
No longer regressions: 1617210
Whiteboard: dt-fission dt-fission-m1 → dt-fission-m1
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: