Closed Bug 1712739 Opened 3 years ago Closed 3 years ago

Migrate ConsoleCommand.evaluateJSAsync and WebConsoleFront.evaluateJSAsync to a command

Categories

(DevTools :: Console, task)

task

Tracking

(firefox91 fixed)

RESOLVED FIXED
91 Branch
Tracking Status
firefox91 --- fixed

People

(Reporter: ochameau, Assigned: nchevobbe)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

ConsoleCommands should be replaced by a generic command, hosted in devtools/shared/commands.
https://searchfox.org/mozilla-central/source/devtools/client/webconsole/commands.js#17
This would make it easier to use from any place in DevTools frontend and avoid having this console-specific ConsoleCommands module.

While we are at it, we can probably merge it with the front's evaluateJSAsync method:
https://searchfox.org/mozilla-central/source/devtools/client/fronts/webconsole.js#99
and so also move WebConsoleFront.evaluateJSAsync to the command, so that the front is no longer having any custom implementation for this method.
(Long term, fronts should no longer have any custom class)

Depends on: 1712686

This method is meant to replace the direct usage
of webconsoleFront.evaluateJSAsync.
The WebConsoleCommands file is removed, and all
client calls to evaluateJSAsync are migrated to
the new method. Callsites are simplified when
possible, and some test are refactored to switch
to spawned task to retrieve content page information.

Assignee: nobody → nchevobbe
Status: NEW → ASSIGNED
Attachment #9224013 - Attachment description: WIP: Bug 1712739 - [devtools] Fold custom WebConsoleFront#evaluateJSAsync method into jsCommand#evaluateExpression. → Bug 1712739 - [devtools] Fold custom WebConsoleFront#evaluateJSAsync method into jsCommand#evaluateExpression. r=ochameau.
Attachment #9224007 - Attachment description: Bug 1712739 - [devtools] Add a js command with an evaluateExpression method. r=jdescottes. → Bug 1712739 - [devtools] Add a `script` command with an `execute` method. r=jdescottes.
Attachment #9224013 - Attachment description: Bug 1712739 - [devtools] Fold custom WebConsoleFront#evaluateJSAsync method into jsCommand#evaluateExpression. r=ochameau. → Bug 1712739 - [devtools] Fold custom WebConsoleFront#evaluateJSAsync method into scriptCommand#execute. r=ochameau.
Pushed by nchevobbe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ac9ae179ece1
[devtools] Add a `script` command with an `execute` method. r=jdescottes.
https://hg.mozilla.org/integration/autoland/rev/a130967c1393
[devtools] Fold custom WebConsoleFront#evaluateJSAsync method into scriptCommand#execute. r=ochameau.
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 91 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: