Open Bug 725314 Opened 13 years ago Updated 3 years ago

Inspector should expose previously highlighted elements to JavaScript

Categories

(DevTools :: Inspector, enhancement, P3)

enhancement

Tracking

(Not tracked)

People

(Reporter: cedricv, Unassigned)

Details

(Keywords: parity-chrome)

Currently, we only expose the current highlighted element with $0 in JS. It would be handy to push the previouslyy highlighted element to $1 then $2 and so on (as Web Inspector does).
So $n will always be different every time we select a new node. So if you want to repeat a command, you'll have to increment $n every time. Can we get something smarter? (not sure if it's possible).
(In reply to Paul Rouget [:paul] from comment #1) > So $n will always be different every time we select a new node. Nope. Steps are: 1) select <body>, it goes to $0 (as usual) 2) select <h1>, it goes to $0, <body> goes to $1 3) select <span>, it goes to $0, <h1> goes to $2 At step 3, <body> is still at $1 (it was the first highlighted element).
(In reply to Cedric Vivier [:cedricv] from comment #2) > 1) select <body>, it goes to $0 (as usual) Or <body> can be set directly to both $0 and $1 here. > 2) select <h1>, it goes to $0, <body> goes to $1 <h1> directly to $0 and $2. etc.
What's described in comment #2 and #3 is not how Chrome does it (I thought it did :D - well I never went farther than $1), but yeah, I think Paul is right we can be smarter and keep incrementing instead of pushing.
Whiteboard: [chrome-parity] → [parity-chrome]
Filter on CLIMBING SHOES
Priority: -- → P3
Mass bug change to replace various 'parity' whiteboard flags with the new canonical keywords. (See bug 1443764 comment 13.)
Keywords: parity-chrome
Whiteboard: [parity-chrome]
Product: Firefox → DevTools
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.