9/27/2019

How to Remove Unused JS/CSS with Browser developers tool

Hi.
Today, I will briefly talk about how to identify unused JS and CSS on the web page.
If you take advantage of this, you can reduce unnecessary code, so you can create faster web services.

TL;DR

  1. Chrome Developers Tools
  2. Command + Shift + p
  3. Search Coverage
  4. Click Show Coverage
  5. if you Click Items, show use/unused code(js,css)

Step by Step


1. Chrome Developers Tools

Chrome engines are all the same. (Opera, Brave, etc..)

2. Command + Shift + p
// It is powerfull command! find any browser tools

3. Search Coverage and click Show Coverage

4. Click start capturing coverage

5. if you Click Items, show use/unused code(js,css)
what? 98.8%?????




HAHWUL

Security engineer, Gopher and H4cker!

Share: | Coffee Me:

13 comments:

  1. thanks for the information

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. For Author of Article - Great Content, But I not able to find where is command key on computer (please help!)

    For Visitor of Website - Check Latest Job List - www.listofjob.in

    ReplyDelete
    Replies
    1. Command keys are only used in the Mac. You can use Ctrl + Shift + p in other OS such as Windows or Linux :D

      Delete
    2. Yes, Sir!

      I find that and complete all your process which given above in article, but please tell me then what?

      How can I remove those red colour (unused java scripts). I want to remove those unused java scripts but I not able to make any changes in Google Developer Tool.

      I also copy those codes and try to find those codes on my website's templete but templete not show any of those codes. {My website is in blogger. So, give me solution which I can implement}

      Delete