Skip to content

Using the capo.js snippet

capo.js snippet

The capo.js snippet is a small script that you can manually run in DevTools. The output is written to the console and includes validation warnings, the actual <head> order, and the sorted <head> order.

DevTools installation

Here’s how to install the snippet to Chrome DevTools:

  1. Copy capo.js

  2. Open DevTools and navigate to the Snippets view of the Sources panel

    Sources panel of DevTools

  3. Select + New Snippet, name it capo.js, and paste the script

    DevTools snippet

To run the snippet:

  • Press the â–· button
  • Press Cmd+Enter

Navigate to the Console panel to view the results.

Console output in DevTools

Bookmarklet installation

Bookmarklets are tiny scripts that you can execute as if you were opening a bookmarked page. To set it up for capo.js:

  1. Copy capo.js

  2. Use a tool like this one to create the bookmarklet

    Configuring the bookmarklet

  3. Drag the link to your bookmarks bar and click it to execute on any web page

    capo.js on the bookmark bar

To run the bookmarklet, just click it like a normal bookmark.

Open DevTools and navigate to the Console panel to view the results.

Console output in DevTools

Configuration

You can customize how capo.js behaves by setting a global config object. See the Configuration guide for more.