DevTools icon indicating copy to clipboard operation
DevTools copied to clipboard

Show source of selector stats

Open Whip opened this issue 2 years ago • 4 comments

Loving the feature of Performance > Selector stats. Its really useful however it would be even better if Edge could show where it found a specific selector in file and line number or multiple places. Also an ability to Ctrl + C on the selector would be handy to copy and search in the code.

AB#44039946

Whip avatar Apr 03 '23 09:04 Whip

Thanks for the feedback. We recently added the ability to copy the content of the Selector Stats table. You can click and drag anywhere in the table to select text and then copy it. In fact, you can also copy the entire table and paste it in Excel for example. This can be very useful when you want to do some aggregate analysis over multiple recalculate style events. Let me know if this helps you search for specific selectors in DevTools.

Now, as for showing the actual file names and line numbers, I'm not entirely sure how feasible this might be. I'm not sure if this information is preserved in this part of the brower's rendering pipeline.

@robpaveza, would you be able to help here? I'll mark this up as a feature request and make sure it shows up on the team's radar. But I thought it would help having some early discussion on the feasibility here.

captainbrosset avatar Apr 04 '23 13:04 captainbrosset

Thanks for the quick update. As a web designer, this would be a great help if it can be done.

Whip avatar Apr 05 '23 02:04 Whip

Thanks @Whip for the feedback. Below are things already in our plans and we're currently working on adding them:

  • ability to copy entire Selector Stats table
  • linking to originating source of selectors

leotlee avatar Apr 05 '23 18:04 leotlee

We recently added the ability to copy the content of the Selector Stats table. You can click and drag anywhere in the table to select text and then copy it.

I love this ability, but there is a problem: it doesn't work for large stylesheets. The Selector Stats table uses virtual scrolling and it does not copy all rows if you have 100s of them. To some extent this can be fixed by reducing the font size in DevTools, but that's still not enough for my app.

Looking forward to the ability to copy entire Selector Stats table, or to download it as CSV.

linking to originating source of selectors

This is by far more important, especially given that:

  • user agent stylesheets are mixed with page stylesheets
  • the tool would be the most useful if it used a sourcemap to link to the original source (SCSS, etc)

warpech avatar May 10 '23 08:05 warpech