How to debug DevTools with DevTools
Tags: webdev, tooling, css
Published: 2021-04-01 19:24:38

The developer tools built into Chromium-based web browsers are&mdash;like the apps they debug&mdash;built in plain old HTML, CSS, and Javascript.

If DevTools are essentially just a web app, you should be able to run DevTools on DevTools, right? Indeed, you can! In fact, you don't need to install any special tooling to try it. Everything you need is already in your browser.

---

## How to run DevTools on DevTools

1. Open your Chromium-based browser (Edge, Chrome, *etc.*) and press **F12** to open DevTools.
2. Pop out the DevTools in their own window by going to the **... menu** at the top right and choosing "Undock into separate window," which is the first icon in the Dock side options.
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cg1hprjelrse5d5kho6q.png)
<figcaption>Undocking DevTools</figcaption>
3. With the DevTools window active, press **Ctrl-Shift-I** (PC) or **Cmd-Shift-I** (Mac) to open a second instance of DevTools on DevTools.

Now, you can use the Inspect tool in the newly-opened DevTools instance to hover over elements in the previously-opened DevTools instance. You can tweak `div` sizes, colors, fonts, and more in the Styles pane, and changes will be reflected right away.

Any changes you make to DevTools won't persist and will reset on reload, so let your imagination run free!

![clippy-anim](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7ymcyyw00qxjn5pgepgg.gif)
<figcaption>Pink backgrounds, Comic Sans... whatever you can do with DevTools, you can do with DevTools on DevTools. By the way: This nifty Font Editor is an experimental feature you can enable in ... > Settings > Experiments to try before it's officially released.</figcaption>

---

## But why?

Aside from having a new party trick to show off, why would you want to run DevTools on DevTools?

One useful scenario is for [authoring and debugging DevTools extensions](https://docs.microsoft.com/microsoft-edge/extensions-chromium/). Developer extensions for React and Vue, for example, are DevTools extensions. If you're authoring your own DevTools extension, you might find DevTools-on-DevTools useful.

Another use case would be for those who want to [fix bugs](https://bugs.chromium.org/p/chromium/issues/list) or add new features to the Chromium DevTools codebase. In fact, the folks who *build* DevTools use DevTools-on-DevTools quite a bit to debug, mock up, and build new features. How do I know? Well, I'm one of those folks! 👋

I have been working with some colleagues on a new interface in Edge DevTools called [Focus Mode](https://github.com/hxlnt/MSEdgeExplainers/blob/main/DevTools/FocusMode/explainer.md), which allows you to group different tabs together so your DevTools don't get too cluttered and overwhelming. Running DevTools against DevTools, I was able to use our [flexbox debugging features](https://docs.microsoft.com/en-us/microsoft-edge/devtools-guide-chromium/experimental-features/#enable-new-css-flexbox-debugging-features) to add outlines to the flex items contained in the new Activity Bar along the left side. I could also play with the size and positioning of icons to make high-fidelity mockups to share with my team.

![debug-activity](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rxbx6tanbhtreg9xefk5.gif)

So, there you have it! Simple instructions for debugging DevTools with DevTools. 🎀