<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Devtools on Brandon Pugh&#39;s Blog</title>
    <link>https://www.brandonpugh.com/tags/devtools/</link>
    <description>Recent content in Devtools on Brandon Pugh&#39;s Blog</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <lastBuildDate>Thu, 27 Jun 2024 00:00:00 +0000</lastBuildDate><atom:link href="https://www.brandonpugh.com/tags/devtools/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Clear site data</title>
      <link>https://www.brandonpugh.com/til/devtools/clear-site-data/</link>
      <pubDate>Thu, 27 Jun 2024 00:00:00 +0000</pubDate>
      <guid>https://www.brandonpugh.com/til/devtools/clear-site-data/</guid>
      <description>&lt;p&gt;protip: if you need to clear out some saved data (like cookies) for a particular site, Chrome dev tools has a handy &amp;ldquo;Clear site data&amp;rdquo; function.&lt;/p&gt;
&lt;p&gt;You can get to it from the &amp;ldquo;Application&amp;rdquo; tab:&lt;/p&gt;
&lt;p&gt;&lt;img alt=&#34;alt text&#34; loading=&#34;lazy&#34; src=&#34;image-1.png&#34;&gt;&lt;/p&gt;
&lt;p&gt;or from the command palette which you can invoke with &lt;code&gt;ctrl+shift+p&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img alt=&#34;alt text&#34; loading=&#34;lazy&#34; src=&#34;image-2.png&#34;&gt;&lt;/p&gt;
&lt;p&gt;To me this is much more convenient than trying to go through the normal user settings for clearing&lt;/p&gt;
&lt;p&gt;There is also chrome://settings/content/siteDetails?site=https%3A%2F%2Flocalhost&lt;/p&gt;

       &lt;hr&gt; &lt;p&gt;Thank you for keeping RSS alive. You&#39;re awesome.&lt;/p&gt; &lt;p&gt;&lt;a href=&#34;mailto:blogrss@bpugh.dev&#34;&gt;Reply by email&lt;/a&gt;&lt;/p&gt;
        &lt;img src=&quot;https://blog.bpugh.workers.dev/cdn/images?p=/til/devtools/clear-site-data/feed&quot;&gt;
      </description>
    </item>
    
    <item>
      <title>Chrome devtools ignores form resubmission</title>
      <link>https://www.brandonpugh.com/til/devtools/ignore-form-resubmission/</link>
      <pubDate>Wed, 12 Jun 2024 00:00:00 +0000</pubDate>
      <guid>https://www.brandonpugh.com/til/devtools/ignore-form-resubmission/</guid>
      <description>&lt;p&gt;Today I learned that if you have the chrome devtools open, then Chrome will suppress the confirm form resubmission dialog:&lt;/p&gt;
&lt;p&gt;&lt;img alt=&#34;screenshot of chrome resubmission dialog&#34; loading=&#34;lazy&#34; src=&#34;ignore-form-resubmission.png&#34;&gt;&lt;/p&gt;
&lt;p&gt;This threw me off for a minute because I couldn&amp;rsquo;t figure out how the page was maintaining the state when I would refresh after a post.&lt;/p&gt;
&lt;p&gt;I couldn&amp;rsquo;t find it documented anywhere but it&amp;rsquo;s a nice convenience during development though it could be confusing if you&amp;rsquo;re unaware of it.&lt;/p&gt;

       &lt;hr&gt; &lt;p&gt;Thank you for keeping RSS alive. You&#39;re awesome.&lt;/p&gt; &lt;p&gt;&lt;a href=&#34;mailto:blogrss@bpugh.dev&#34;&gt;Reply by email&lt;/a&gt;&lt;/p&gt;
        &lt;img src=&quot;https://blog.bpugh.workers.dev/cdn/images?p=/til/devtools/ignore-form-resubmission/feed&quot;&gt;
      </description>
    </item>
    
    <item>
      <title>Penpot</title>
      <link>https://www.brandonpugh.com/til/devtools/penpot/</link>
      <pubDate>Wed, 22 May 2024 00:00:00 +0000</pubDate>
      <guid>https://www.brandonpugh.com/til/devtools/penpot/</guid>
      <description>&lt;p&gt;I just heard about a promising new design tool called &lt;a href=&#34;https://penpot.app/&#34;&gt;Penpot&lt;/a&gt; that positions itself as an open-source alternative to Figma.&lt;/p&gt;
&lt;p&gt;They recently added support for CSS grid layout which I&amp;rsquo;m looking forward to testing out.&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://www.smashingmagazine.com/2024/04/penpot-css-grid-layout-designing-superpowers/&#34;&gt;https://www.smashingmagazine.com/2024/04/penpot-css-grid-layout-designing-superpowers/&lt;/a&gt;&lt;/p&gt;

       &lt;hr&gt; &lt;p&gt;Thank you for keeping RSS alive. You&#39;re awesome.&lt;/p&gt; &lt;p&gt;&lt;a href=&#34;mailto:blogrss@bpugh.dev&#34;&gt;Reply by email&lt;/a&gt;&lt;/p&gt;
        &lt;img src=&quot;https://blog.bpugh.workers.dev/cdn/images?p=/til/devtools/penpot/feed&quot;&gt;
      </description>
    </item>
    
    <item>
      <title>Locally test on old version of Chrome</title>
      <link>https://www.brandonpugh.com/til/devtools/chromium-versions/</link>
      <pubDate>Mon, 20 May 2024 00:00:00 +0000</pubDate>
      <guid>https://www.brandonpugh.com/til/devtools/chromium-versions/</guid>
      <description>&lt;p&gt;Today I learned that if you need to test in older versions of Chrome then you can &lt;a href=&#34;https://commondatastorage.googleapis.com/chromium-browser-snapshots/index.html&#34;&gt;download prior snapshots of Chromium builds&lt;/a&gt; as standalone executables.&lt;/p&gt;
&lt;p&gt;The tricky part is figuring out which build snapshot corresponds to which version of Chrome, which involves several steps detailed in the &lt;a href=&#34;https://www.chromium.org/getting-involved/download-chromium/#downloading-old-builds-of-chrome-chromium&#34;&gt;Chromium wiki&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Fortunately, someone put together a site to &lt;a href=&#34;https://vikyd.github.io/download-chromium-history-version/#/&#34;&gt;lookup by Chrome version&lt;/a&gt; and link to the correct build on the archive site.
Then you download and extract the zip file and run the single executable, i.e. &lt;code&gt;chrome.exe&lt;/code&gt;.&lt;/p&gt;

       &lt;hr&gt; &lt;p&gt;Thank you for keeping RSS alive. You&#39;re awesome.&lt;/p&gt; &lt;p&gt;&lt;a href=&#34;mailto:blogrss@bpugh.dev&#34;&gt;Reply by email&lt;/a&gt;&lt;/p&gt;
        &lt;img src=&quot;https://blog.bpugh.workers.dev/cdn/images?p=/til/devtools/chromium-versions/feed&quot;&gt;
      </description>
    </item>
    
    <item>
      <title>sourceURL pragma</title>
      <link>https://www.brandonpugh.com/til/devtools/inline-script-sourceurl/</link>
      <pubDate>Mon, 29 Jan 2024 00:00:00 +0000</pubDate>
      <guid>https://www.brandonpugh.com/til/devtools/inline-script-sourceurl/</guid>
      <description>&lt;p&gt;Today I learned that you can add &lt;code&gt;//# sourceURL=&amp;lt;anything&amp;gt;.js&lt;/code&gt; special comment to an inline script tag to have it show up as a separate javascript file in the dev tools sources tab.&lt;/p&gt;
&lt;p&gt;This makes it a bit easier to work with especially when you have a huge inline script tag you&amp;rsquo;re dealing with.&lt;/p&gt;
&lt;p&gt;It even works with &lt;code&gt;eval()&lt;/code&gt; too if you&amp;rsquo;re unfortunate enough to be dealing with that.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&#34;screenshot of an inline script showing as a separate .js file in devtools&#34; loading=&#34;lazy&#34; src=&#34;inline-script-sourceurl.png&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://devtoolstips.org/tips/en/name-evaluated-files/&#34;&gt;https://devtoolstips.org/tips/en/name-evaluated-files/&lt;/a&gt;&lt;/p&gt;

       &lt;hr&gt; &lt;p&gt;Thank you for keeping RSS alive. You&#39;re awesome.&lt;/p&gt; &lt;p&gt;&lt;a href=&#34;mailto:blogrss@bpugh.dev&#34;&gt;Reply by email&lt;/a&gt;&lt;/p&gt;
        &lt;img src=&quot;https://blog.bpugh.workers.dev/cdn/images?p=/til/devtools/inline-script-sourceurl/feed&quot;&gt;
      </description>
    </item>
    
    <item>
      <title>Local overrides in Chrome DevTools</title>
      <link>https://www.brandonpugh.com/til/devtools/local-overrides/</link>
      <pubDate>Mon, 11 Dec 2023 00:00:00 +0000</pubDate>
      <guid>https://www.brandonpugh.com/til/devtools/local-overrides/</guid>
      <description>&lt;p&gt;Today I learned about the &lt;a href=&#34;https://developer.chrome.com/docs/devtools/overrides&#34;&gt;local overrides&lt;/a&gt; feature of Chrome Devtools that lets you &amp;ldquo;you can override HTTP response headers and web content, including XHR and fetch requests, to mock remote resources even if you don&amp;rsquo;t have access to them&amp;rdquo;.&lt;/p&gt;
&lt;p&gt;This came in handy for me when trying to debug an issue that I wasn&amp;rsquo;t able to reproduce locally. The official docs do a nice job showing how to enable the feature but just make sure you delete the override once you&amp;rsquo;re done otherwise you might wonder why the page has stopped updating.&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://developer.chrome.com/docs/devtools/overrides&#34;&gt;https://developer.chrome.com/docs/devtools/overrides&lt;/a&gt;&lt;/p&gt;

       &lt;hr&gt; &lt;p&gt;Thank you for keeping RSS alive. You&#39;re awesome.&lt;/p&gt; &lt;p&gt;&lt;a href=&#34;mailto:blogrss@bpugh.dev&#34;&gt;Reply by email&lt;/a&gt;&lt;/p&gt;
        &lt;img src=&quot;https://blog.bpugh.workers.dev/cdn/images?p=/til/devtools/local-overrides/feed&quot;&gt;
      </description>
    </item>
    
    <item>
      <title>Toggle CSS classes in Devtools</title>
      <link>https://www.brandonpugh.com/til/devtools/toggle-css-classes/</link>
      <pubDate>Fri, 13 Oct 2023 00:00:00 +0000</pubDate>
      <guid>https://www.brandonpugh.com/til/devtools/toggle-css-classes/</guid>
      <description>&lt;p&gt;Today I learned that the little &lt;code&gt;.cls&lt;/code&gt; button in the Chrome devtools is a handy way to toggle classes on an element:&lt;/p&gt;
&lt;p&gt;&lt;img alt=&#34;toggle class screenshot&#34; loading=&#34;lazy&#34; src=&#34;toggle-css-classes.png&#34;&gt;&lt;/p&gt;
&lt;p&gt;I imagine the trend of using utility classes was the main motivation for this feature (although apparently it&amp;rsquo;s been there for a few years and I only just figured out what it was for).&lt;/p&gt;

       &lt;hr&gt; &lt;p&gt;Thank you for keeping RSS alive. You&#39;re awesome.&lt;/p&gt; &lt;p&gt;&lt;a href=&#34;mailto:blogrss@bpugh.dev&#34;&gt;Reply by email&lt;/a&gt;&lt;/p&gt;
        &lt;img src=&quot;https://blog.bpugh.workers.dev/cdn/images?p=/til/devtools/toggle-css-classes/feed&quot;&gt;
      </description>
    </item>
    
    <item>
      <title>Emulate page focus</title>
      <link>https://www.brandonpugh.com/til/devtools/emulate-focused-page/</link>
      <pubDate>Mon, 28 Aug 2023 00:00:00 +0000</pubDate>
      <guid>https://www.brandonpugh.com/til/devtools/emulate-focused-page/</guid>
      <description>&lt;p&gt;Today I learned about a devtools feature that helped me debug the styling of an element that would disappear when the input element lost focus which happens when you click over to the devtools.&lt;/p&gt;
&lt;p&gt;If you press &lt;code&gt;ctrl+shift+p&lt;/code&gt; to open the command palette in DevTools, and type &amp;ldquo;focus&amp;rdquo;, you&amp;rsquo;ll see a command to &amp;ldquo;Emulate a focused page&amp;rdquo; which will leave the focus on the element in the page even when you click into the DevTools.&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://levelup.gitconnected.com/different-ways-to-inspect-disappearing-elements-on-a-browser-5df42888b7cf&#34;&gt;This post&lt;/a&gt; shows several other techniques you could potentially use but I found this option to work best for my scenario.&lt;/p&gt;
&lt;p&gt;My favorite technique is this clever javascript snippet you can run from the console:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-js&#34; data-lang=&#34;js&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;setTimeout&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kd&#34;&gt;function&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kr&#34;&gt;debugger&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;},&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;3000&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
       &lt;hr&gt; &lt;p&gt;Thank you for keeping RSS alive. You&#39;re awesome.&lt;/p&gt; &lt;p&gt;&lt;a href=&#34;mailto:blogrss@bpugh.dev&#34;&gt;Reply by email&lt;/a&gt;&lt;/p&gt;
        &lt;img src=&quot;https://blog.bpugh.workers.dev/cdn/images?p=/til/devtools/emulate-focused-page/feed&quot;&gt;
      </description>
    </item>
    
    <item>
      <title>Find all CSS changes in Chrome DevTools</title>
      <link>https://www.brandonpugh.com/til/devtools/css-changes/</link>
      <pubDate>Tue, 15 Aug 2023 00:00:00 +0000</pubDate>
      <guid>https://www.brandonpugh.com/til/devtools/css-changes/</guid>
      <description>&lt;p&gt;Today I learned about the &lt;a href=&#34;https://developer.chrome.com/docs/devtools/changes/&#34;&gt;Changes tab&lt;/a&gt; in Chrome devtools.&lt;/p&gt;
&lt;p&gt;When you&amp;rsquo;re tweaking CSS styles in Chrome DevTools, you can see all the changes you&amp;rsquo;ve made by clicking the &amp;ldquo;Changes&amp;rdquo; tab in the bottom &amp;ldquo;drawer&amp;rdquo; in DevTools.
It&amp;rsquo;s especially nice because you can then copy the changes to your clipboard and paste them into your actual source file.
You can open it from the command palette (&lt;code&gt;ctrl+shift+p&lt;/code&gt;) and typing &amp;ldquo;show changes&amp;rdquo;.&lt;/p&gt;
&lt;p&gt;One caveat I&amp;rsquo;ve noticed is that it doesn&amp;rsquo;t show styles you&amp;rsquo;ve added directly to an element as an inline style.&lt;/p&gt;

       &lt;hr&gt; &lt;p&gt;Thank you for keeping RSS alive. You&#39;re awesome.&lt;/p&gt; &lt;p&gt;&lt;a href=&#34;mailto:blogrss@bpugh.dev&#34;&gt;Reply by email&lt;/a&gt;&lt;/p&gt;
        &lt;img src=&quot;https://blog.bpugh.workers.dev/cdn/images?p=/til/devtools/css-changes/feed&quot;&gt;
      </description>
    </item>
    
    <item>
      <title>Use the Chrome devtools recorder to automate UI testing</title>
      <link>https://www.brandonpugh.com/til/devtools/devtools-recorder/</link>
      <pubDate>Tue, 11 Jul 2023 00:00:00 +0000</pubDate>
      <guid>https://www.brandonpugh.com/til/devtools/devtools-recorder/</guid>
      <description>&lt;p&gt;Chrome devtools has a pretty decent recorder feature that can record and playback your UI interactions.
It&amp;rsquo;s currently in preview but it&amp;rsquo;s been working well for me so far.&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s especially handy if you have to keep repeating the same 5 steps every time you reload the page to test your code.&lt;/p&gt;
&lt;p&gt;It automatically waits for UI elements to load and it&amp;rsquo;s pretty easy to tweak the recorded steps and export as a puppeteer script: &lt;a href=&#34;https://developer.chrome.com/docs/devtools/recorder/&#34;&gt;https://developer.chrome.com/docs/devtools/recorder/&lt;/a&gt;&lt;/p&gt;

       &lt;hr&gt; &lt;p&gt;Thank you for keeping RSS alive. You&#39;re awesome.&lt;/p&gt; &lt;p&gt;&lt;a href=&#34;mailto:blogrss@bpugh.dev&#34;&gt;Reply by email&lt;/a&gt;&lt;/p&gt;
        &lt;img src=&quot;https://blog.bpugh.workers.dev/cdn/images?p=/til/devtools/devtools-recorder/feed&quot;&gt;
      </description>
    </item>
    
  </channel>
</rss>