Open Bug 1270015 Opened 5 years ago Updated 3 years ago

Smarter suggestions for DOM properties

Categories

(DevTools :: Console, enhancement, P3)

enhancement

Tracking

(Not tracked)

People

(Reporter: sebo, Unassigned)

References

(Blocks 2 open bugs)

Details

The auto-completion within the Web console's command line should be smarter with its suggestions.

E.g. when entering a 'd' the probability that the user wants to enter 'document' is much higher than for 'decodeURI', which is the current default suggestion.

It would improve UX a lot if the most common properties, functions, etc. would be selected by default similar to what was done for CSS properties in bug 1168246.

To get 'document.getElementById' you'd then only have to do this:

d<Tab>.<Tab>

instead of

do<Tab>.getElementB<Tab>

Firebug has this already, see https://github.com/firebug/firebug/blob/master/extension/content/firebug/console/autoCompleter.js#L357-L365.

Sebastian
> https://github.com/firebug/firebug/blob/master/extension/content/firebug/console/autoCompleter.js#L357-L365

Note that this list, together with surrounding code, represents the tweaks I felt were needed to Firebug's default heuristics to make suggestions subjectively feel good for all of "document.[a-z]", "[a-z]", "console.", "aDomNode.[a-z]", "aFunction.[a-z]". The devtools console uses different heuristics and will need different tweaks. (Firebug hides everything from Object.prototype and generally defaults to the shortest property name rather than the first one lexicographically, which is a bit confusing but also gives reasonably good results in practice.)
Looks like the list of css properties was generated from https://www.chromestatus.com/metrics/css/popularity.  I wonder if they have similar data for properties accessed on Document, DOMNode, etc.  This doesn't seem to include that info: https://www.chromestatus.com/metrics/feature/popularity
Priority: -- → P3
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.