Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to audit multiple pages with Chrome Developer tools?

I am trying to find out unused CSS class in my website, and then I found that there is a audit function in Chrome developer tools that will mark unused CSS classes. However, it is only doing one page at a time. Is there a way to make it audit multiple pages so that I can find out CSS classes that are not used in all pages?

I know there is a Firefox plugin Dust-Me that do the job. I am asking just to find if I can do that with Chrome alone, as I am more familiar with Chrome Developer tools.

like image 868
cytsunny Avatar asked Mar 09 '17 02:03

cytsunny


People also ask

What can you do with Chrome developer tools?

Chrome Developer Tools is a comprehensive toolkit for developers, built directly into the Chrome browser. These tools let you edit web pages in real time, diagnose problems more quickly, and build better websites faster.

How do I customize Chrome developer tools?

Goto chrome://flags/#enable-devtools-experiments , and enable Developer Tools experiments . Select Relaunch Now at the bottom of the page. F12 to Open developer tools, go to Settings , select Experiments tab, and check Allow custom UI themes .

What is preview in Chrome developer tools?

Preview contains a preview of the resource, for example a rendered image or some source code. Response is similar to Preview and shows what was received from the server. Cookies (if any) shows cookies sent with the request. Timing contains information on how long a request actually took to download.


1 Answers

There's a pretty recent browser extension called DisCoverage that is supposed to be able to do this. Read the description because version 1.0 of the extension is not able to automate the whole thing and you need to manually export a file for each page you visit and finally combine those files using the same extension.

Hopefully this extension will be improved in the future to be able to collect coverage reports automatically and the allow combining multiple results with a nice UI.

(The extension basically uses Coverage feature of Developer Tools and exports result of coverage for each page into separate files in a single directory. It also contains a feature to combine multiple coverage reports into single final report for viewing the results.)

like image 70
Mikko Rantalainen Avatar answered Sep 17 '22 17:09

Mikko Rantalainen