As a web developer I want to have access to the properties of the inspected element without having to remember all of them and write their full names.
47 bytes, text/x-phabricator-request
|Details | Review|
Right now if you run `$0.` in the console you don't get any autocompletion. However if you do `foo = $0;` then run `foo.` you do. I think it has to do with the fact that $0 is added as an extra binding for the debugger and the JSPropertyProvider we use for webconsole just looks in the normal environment.
I stumble over this issue every day. This bug limits the usefulness of $0 a lot, because you have to know and type out all the properties by yourself. Brian, it sounded like you had an idea how to fix this. Could this please get some priority? Sebastian
I agree this would be a great feature to have. But I don't expect to have the cycles to look into this in the near future as we are focused right now on getting the new console frontend shipped to release. If someone wanted to look into this, I'd start in the JSPropertyProvider, where we have some special case handing for `this` . I expect we could add something similar for $0. $0 is special cased in the backend as a WebConsoleCommand , and we should be able to do a call similar to what is being done there, if we pass the selected node into it. In that case, the selectedNode object is created from a property sent from client `selectedNodeActor` . : https://dxr.mozilla.org/mozilla-central/source/devtools/shared/webconsole/js-property-provider.js#228-235 : https://dxr.mozilla.org/mozilla-central/source/devtools/server/actors/webconsole/utils.js#379-383 : https://dxr.mozilla.org/mozilla-central/source/devtools/server/actors/webconsole.js#1344-1349
Priority: -- → P3
Duplicate of this bug: 1369608
Whiteboard: [polish-backlog] → [boogaloo-reserve] [polish-backlog]
Whiteboard: [boogaloo-reserve] [polish-backlog] → [boogaloo-mvp] [polish-backlog]
Assignee: nobody → nchevobbe
Status: NEW → ASSIGNED
Priority: P2 → P1
To make $0 autocompletion work, we need to pass the current selectedNode actor from the frontend, so we can retrieve the object reference later. For $_, we need the webconsole actor reference to be able to retrieve the last input result. Since the list of parameters of JsPropertyProviders was getting a bit long, we transform them in an object so it's more legible on the consumer side. Mochitests are added for both helpers to ensure this work as expected.
Pushed by firstname.lastname@example.org: https://hg.mozilla.org/integration/autoland/rev/18eddae8a268 Make autocompletion work on $_ and $0; r=bgrins.
I can verify that the autocompletion for $0 and $_ works in Nightly 2018-11-15, while it didn't work in 2018-11-14. This was one of the major regressions on the transition from Firebug to the DevTools, especially $0. So, thank you very much for this change, Nicolas! Sebastian
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.