Bug 1605323 - Set toolbox context in "Store as global variable" context menu entry. r=jlast.
authorNicolas Chevobbe <nchevobbe@mozilla.com>
Tue, 24 Mar 2020 20:56:25 +0000
changeset 520330 333706f92cf5aab3f9411c7d052ca9472fdbb2c8
parent 520329 4ba2354af2808054e763a486fbf6f72adca7e18e
child 520331 7172c878c66e6b997d823ce37c6f9491e856bbae
push id37248
push userbtara@mozilla.com
push dateWed, 25 Mar 2020 16:40:49 +0000
treeherdermozilla-central@c5112a7573ac [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjlast
bugs1605323
milestone76.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1605323 - Set toolbox context in "Store as global variable" context menu entry. r=jlast. Differential Revision: https://phabricator.services.mozilla.com/D67815
devtools/client/webconsole/actions/object.js
--- a/devtools/client/webconsole/actions/object.js
+++ b/devtools/client/webconsole/actions/object.js
@@ -19,16 +19,28 @@ function storeAsGlobal(actor) {
       }
       this["temp" + i] = _self;
       "temp" + i;
     }`;
 
     const res = await client.evaluateJSAsync(evalString, {
       selectedObjectActor: actor,
     });
+
+    // Select the adhoc target in the console.
+    if (hud.toolbox) {
+      const objectFront = client.getFrontByID(actor);
+      if (objectFront) {
+        const threadActorID = objectFront.targetFront?.threadFront?.actorID;
+        if (threadActorID) {
+          hud.toolbox.selectThread(threadActorID);
+        }
+      }
+    }
+
     hud.focusInput();
     hud.setInputValue(res.result);
   };
 }
 
 function copyMessageObject(actor, variableText) {
   return async ({ client }) => {
     if (actor) {