Smarter suggestions for DOM properties

NEW
Unassigned

Status

enhancement
P3
normal
3 years ago
10 months ago

People

(Reporter: sebo, Unassigned)

Tracking

(Blocks 2 bugs)

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

3 years ago
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

Comment 1

3 years ago
> 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

Updated

10 months ago
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.