Bug 1611682 - Fix show DOM properties. r=rcaliman.

This patch work around the fact that the `inspect` command
is used for different purpose:
- open the evaluated element in the inspector/debugger
- expand a given object in the console

In order to do that, a second parameter is added to indicate
which usage we do want.
This is not pretty, but I can't see something as straightforward
to fix this issue.
Given that there's plan to have a properties sidebar in the
inspector, it might be enough for now.

The existing test is modified to check that the object is indeed
expanded in the console.

Differential Revision: https://phabricator.services.mozilla.com/D61662
This commit is contained in:
Nicolas Chevobbe
2020-02-05 15:23:10 +00:00
parent d5871c12ea
commit e93d973ee2
5 changed files with 29 additions and 16 deletions

View File

@@ -345,7 +345,7 @@ class MarkupContextMenu {
_showDOMProperties() {
this.toolbox.openSplitConsole().then(() => {
const { hud } = this.toolbox.getPanel("webconsole");
hud.ui.wrapper.dispatchEvaluateExpression("inspect($0)");
hud.ui.wrapper.dispatchEvaluateExpression("inspect($0, true)");
});
}