{"id":1570,"date":"2024-04-05T13:14:59","date_gmt":"2024-04-05T19:14:59","guid":{"rendered":"https:\/\/frontendmasters.com\/blog\/?p=1570"},"modified":"2024-04-05T13:15:01","modified_gmt":"2024-04-05T19:15:01","slug":"devtools-tips-tricks","status":"publish","type":"post","link":"https:\/\/frontendmasters.com\/blog\/devtools-tips-tricks\/","title":{"rendered":"DevTools Tips &amp; Tricks"},"content":{"rendered":"\n<p>Front-end developers spend a significant amount of time working inside the browser\u2019s DevTools. Likely just as much as they spend time writing code in the code editor. However, most developers barely scratch the surface of what DevTools can accomplish. I have been curating a collection of DevTools tips across major browsers. The following are some of the useful tips &amp; tricks for across different browsers that will help you unlock the full potential of DevTools.<\/p>\n\n\n\n<p class=\"learn-more\">For the sake of brevity, all the Chromium based browsers like Chrome, Edge, Opera etc,. are referred to as Chromium, because the DevTools experience and features across these browser are very similar.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">1. Inspect Popups on Hover<\/h2>\n\n\n\n<p>If you have ever tried to inspect popup elements like tooltips, dropdown menus etc that only appear on hover, then you would know how hard it is to inspect the popup element. The main problem with inspecting the popup elements is when you click anywhere in the DevTools, the page loses focus, which causes the popup to disappear. To solve this problem, Chromium browsers have a <strong>Emulate a focused page<\/strong> option to keep the page focused while using the DevTools.<\/p>\n\n\n\n<p>There are two ways to access this option in DevTools:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>1. Select the element in the Elements panel that activates the popup on hover. Open the Styles pane, click <code>:hov<\/code> button to activate the hover state. Enable the <strong>Emulate a focused page <\/strong>option to keep the main page focused while you interact with the DevTools.<\/li>\n\n\n\n<li>2. Open the Command Menu, and Run <strong>Show Rendering <\/strong>to open the Rendering drawer at the bottom of the DevTools. Scroll down to find the <strong>Emulate a focused page<\/strong> option and enable it.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"624\" src=\"https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2024\/04\/s_52E2E38C42ACB86B87D3BFE6176695A8B39C9CD0BF6927AACEC92F6B0CF47034_1711647272180_inpect-popup-elements-1024x624.png?resize=1024%2C624&#038;ssl=1\" alt=\"\" class=\"wp-image-1572\" srcset=\"https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2024\/04\/s_52E2E38C42ACB86B87D3BFE6176695A8B39C9CD0BF6927AACEC92F6B0CF47034_1711647272180_inpect-popup-elements.png?resize=1024%2C624&amp;ssl=1 1024w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2024\/04\/s_52E2E38C42ACB86B87D3BFE6176695A8B39C9CD0BF6927AACEC92F6B0CF47034_1711647272180_inpect-popup-elements.png?resize=300%2C183&amp;ssl=1 300w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2024\/04\/s_52E2E38C42ACB86B87D3BFE6176695A8B39C9CD0BF6927AACEC92F6B0CF47034_1711647272180_inpect-popup-elements.png?resize=768%2C468&amp;ssl=1 768w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2024\/04\/s_52E2E38C42ACB86B87D3BFE6176695A8B39C9CD0BF6927AACEC92F6B0CF47034_1711647272180_inpect-popup-elements.png?resize=1536%2C936&amp;ssl=1 1536w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2024\/04\/s_52E2E38C42ACB86B87D3BFE6176695A8B39C9CD0BF6927AACEC92F6B0CF47034_1711647272180_inpect-popup-elements.png?w=1680&amp;ssl=1 1680w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">2. Use logpoints<\/h2>\n\n\n\n<p>Debugging tools in DevTools have come a long way. But if you\u2019re like me, and still prefer <code>console.log<\/code> to debug your code, there is a better way to get log output in the console without cluttering the code with <code>console.log()<\/code> statements. It\u2019s also useful while debugging production code.<\/p>\n\n\n\n<p>For Chromium browsers, open the scripts in the <strong>Sources<\/strong> panel, right click on the line number and select \u201cAdd logpoint\u2026\u201d. Input the message including the variables that you want to log in the console.<\/p>\n\n\n\n\t\t<figure class=\"wp-block-jetpack-videopress jetpack-videopress-player\" style=\"\" >\n\t\t\t<div class=\"jetpack-videopress-player__wrapper\"> <iframe title=\"VideoPress Video Player\" aria-label='VideoPress Video Player' width='500' height='315' src='https:\/\/videopress.com\/embed\/NgDvjA7k?cover=1&amp;autoPlay=0&amp;controls=1&amp;loop=0&amp;muted=0&amp;persistVolume=1&amp;playsinline=0&amp;preloadContent=metadata&amp;useAverageColor=1&amp;hd=0' frameborder='0' allowfullscreen data-resize-to-parent=\"true\" allow='clipboard-write'><\/iframe><script src='https:\/\/v0.wordpress.com\/js\/next\/videopress-iframe.js?m=1674852142'><\/script><\/div>\n\t\t\t\n\t\t\t\n\t\t<\/figure>\n\t\t\n\n\n<p>In Firefox, a similar option is available in the <strong>Debugger<\/strong> panel, after you right click on the line number and select \u201cAdd log\u201d.<\/p>\n\n\n\n\t\t<figure class=\"wp-block-jetpack-videopress jetpack-videopress-player\" style=\"\" >\n\t\t\t<div class=\"jetpack-videopress-player__wrapper\"> <iframe title=\"VideoPress Video Player\" aria-label='VideoPress Video Player' width='500' height='315' src='https:\/\/videopress.com\/embed\/4zunwJKl?cover=1&amp;autoPlay=0&amp;controls=1&amp;loop=0&amp;muted=0&amp;persistVolume=1&amp;playsinline=0&amp;preloadContent=metadata&amp;useAverageColor=1&amp;hd=0' frameborder='0' allowfullscreen data-resize-to-parent=\"true\" allow='clipboard-write'><\/iframe><script src='https:\/\/v0.wordpress.com\/js\/next\/videopress-iframe.js?m=1674852142'><\/script><\/div>\n\t\t\t\n\t\t\t\n\t\t<\/figure>\n\t\t\n\n\n<h2 class=\"wp-block-heading\">3. Emulate foldable devices<\/h2>\n\n\n\n<p>Foldable devices are quite the rage these days. However, your site on a foldable screen may look different than how it looks on a single screen device because of the in-seam separating the two screens. This is a great opportunity to offer an improved UX by designing the site around the constraints of a dual screen by making clever usage of the negative space around the foldable part of the screen. Fortunately, some browsers allow us to emulate a foldable device or a dual screen that can help us design our site around the middle-edge of the screen (the foldable part!).<\/p>\n\n\n\n<p>You can target foldable viewport using <a href=\"https:\/\/www.smashingmagazine.com\/2022\/03\/building-web-layouts-dual-screen-foldable-devices\/\">CSS media queries<\/a>. In Chromium browsers, enter the <strong>Device Emulation<\/strong> mode, select a foldable device, which will add additional buttons to the toolbar. From the toolbar use the buttons to toggle portrait &amp; landscape, or single-screen and dual-screen mode to view how the site looks like in different mode.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"640\" src=\"https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2024\/04\/s_52E2E38C42ACB86B87D3BFE6176695A8B39C9CD0BF6927AACEC92F6B0CF47034_1711707376365_image.png?resize=1024%2C640&#038;ssl=1\" alt=\"\" class=\"wp-image-1581\" srcset=\"https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2024\/04\/s_52E2E38C42ACB86B87D3BFE6176695A8B39C9CD0BF6927AACEC92F6B0CF47034_1711707376365_image.png?resize=1024%2C640&amp;ssl=1 1024w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2024\/04\/s_52E2E38C42ACB86B87D3BFE6176695A8B39C9CD0BF6927AACEC92F6B0CF47034_1711707376365_image.png?resize=300%2C187&amp;ssl=1 300w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2024\/04\/s_52E2E38C42ACB86B87D3BFE6176695A8B39C9CD0BF6927AACEC92F6B0CF47034_1711707376365_image.png?resize=768%2C480&amp;ssl=1 768w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2024\/04\/s_52E2E38C42ACB86B87D3BFE6176695A8B39C9CD0BF6927AACEC92F6B0CF47034_1711707376365_image.png?resize=1536%2C959&amp;ssl=1 1536w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2024\/04\/s_52E2E38C42ACB86B87D3BFE6176695A8B39C9CD0BF6927AACEC92F6B0CF47034_1711707376365_image.png?w=1710&amp;ssl=1 1710w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">4. Autocomplete styles<\/h2>\n\n\n\n<p>Chromium browsers allows you to input declarations by just entering the value, and the DevTools will auto suggest the closest matching property-value pair. For example, we can input <code>bold<\/code> and DevTools will automatically suggest <code>font-weight: bold<\/code> as the top choice to select.<\/p>\n\n\n\n\t\t<figure class=\"wp-block-jetpack-videopress jetpack-videopress-player\" style=\"\" >\n\t\t\t<div class=\"jetpack-videopress-player__wrapper\"> <iframe title=\"VideoPress Video Player\" aria-label='VideoPress Video Player' width='500' height='315' src='https:\/\/videopress.com\/embed\/7nQ1DS8w?cover=1&amp;autoPlay=0&amp;controls=1&amp;loop=0&amp;muted=0&amp;persistVolume=1&amp;playsinline=0&amp;preloadContent=metadata&amp;useAverageColor=1&amp;hd=0' frameborder='0' allowfullscreen data-resize-to-parent=\"true\" allow='clipboard-write'><\/iframe><script src='https:\/\/v0.wordpress.com\/js\/next\/videopress-iframe.js?m=1674852142'><\/script><\/div>\n\t\t\t\n\t\t\t\n\t\t<\/figure>\n\t\t\n\n\n<p>In Safari, you can have a typo in your declaration and the web inspector will try to fuzzy match and suggest the closest matching property: value pair.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"640\" src=\"https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2024\/04\/s_52E2E38C42ACB86B87D3BFE6176695A8B39C9CD0BF6927AACEC92F6B0CF47034_1711708171747_image.png?resize=1024%2C640&#038;ssl=1\" alt=\"\" class=\"wp-image-1583\" srcset=\"https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2024\/04\/s_52E2E38C42ACB86B87D3BFE6176695A8B39C9CD0BF6927AACEC92F6B0CF47034_1711708171747_image.png?resize=1024%2C640&amp;ssl=1 1024w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2024\/04\/s_52E2E38C42ACB86B87D3BFE6176695A8B39C9CD0BF6927AACEC92F6B0CF47034_1711708171747_image.png?resize=300%2C187&amp;ssl=1 300w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2024\/04\/s_52E2E38C42ACB86B87D3BFE6176695A8B39C9CD0BF6927AACEC92F6B0CF47034_1711708171747_image.png?resize=768%2C480&amp;ssl=1 768w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2024\/04\/s_52E2E38C42ACB86B87D3BFE6176695A8B39C9CD0BF6927AACEC92F6B0CF47034_1711708171747_image.png?resize=1536%2C959&amp;ssl=1 1536w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2024\/04\/s_52E2E38C42ACB86B87D3BFE6176695A8B39C9CD0BF6927AACEC92F6B0CF47034_1711708171747_image.png?w=1710&amp;ssl=1 1710w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">5. Color formats<\/h2>\n\n\n\n<p>All major browser DevTools allows you to toggle the authored color formats by holding the <code>Shift<\/code> key and click the color preview box to cycle through various color formats like, <code>hex<\/code>, <code>rgb<\/code>, <code>hsl<\/code>, <code>hwb<\/code>. Alternatively, you can also change the color format in the <a href=\"https:\/\/developer.chrome.com\/docs\/devtools\/css\/reference\/#color-picker\">color picker<\/a> using the up-down arrow keys.<\/p>\n\n\n\n\t\t<figure class=\"wp-block-jetpack-videopress jetpack-videopress-player\" style=\"\" >\n\t\t\t<div class=\"jetpack-videopress-player__wrapper\"> <iframe title=\"VideoPress Video Player\" aria-label='VideoPress Video Player' width='500' height='315' src='https:\/\/videopress.com\/embed\/WKZHNjIT?cover=1&amp;autoPlay=0&amp;controls=1&amp;loop=0&amp;muted=0&amp;persistVolume=1&amp;playsinline=0&amp;preloadContent=metadata&amp;useAverageColor=1&amp;hd=0' frameborder='0' allowfullscreen data-resize-to-parent=\"true\" allow='clipboard-write'><\/iframe><script src='https:\/\/v0.wordpress.com\/js\/next\/videopress-iframe.js?m=1674852142'><\/script><\/div>\n\t\t\t\n\t\t\t\n\t\t<\/figure>\n\t\t\n\n\n<p>In Chromium &amp; Safari browsers, you can use the color picker to pick a color from outside the browser window. Safari also lets you change the color format to <code>display-p3<\/code>. The white line in the demo below shows the edge of sRGB. Everything on its top right is <strong>Display-P3<\/strong> colors not available in sRGB. For fallback, right click on the color box, and select &#8220;Clamp to sRGB&#8221; to convert to the closest available color in the sRGB space.<\/p>\n\n\n\n\t\t<figure class=\"wp-block-jetpack-videopress jetpack-videopress-player\" style=\"\" >\n\t\t\t<div class=\"jetpack-videopress-player__wrapper\"> <iframe title=\"VideoPress Video Player\" aria-label='VideoPress Video Player' width='500' height='315' src='https:\/\/videopress.com\/embed\/RXe4yGYf?cover=1&amp;autoPlay=0&amp;controls=1&amp;loop=0&amp;muted=0&amp;persistVolume=1&amp;playsinline=0&amp;preloadContent=metadata&amp;useAverageColor=1&amp;hd=0' frameborder='0' allowfullscreen data-resize-to-parent=\"true\" allow='clipboard-write'><\/iframe><script src='https:\/\/v0.wordpress.com\/js\/next\/videopress-iframe.js?m=1674852142'><\/script><\/div>\n\t\t\t\n\t\t\t\n\t\t<\/figure>\n\t\t\n\n\n<h2 class=\"wp-block-heading\">6. Capture High-res screenshot<\/h2>\n\n\n\n<p>Sometimes you may use a <a href=\"https:\/\/chromewebstore.google.com\/detail\/awesome-screen-recorder-s\/nlipoenfbbikpbjkfpfillcgkoblgpmj?hl=en\">browser extension<\/a> or a <a href=\"https:\/\/pikwy.com\/\">third party service<\/a> or a <a href=\"https:\/\/www.npmjs.com\/package\/capture-website\">node.js library<\/a> to take a high resolution screenshot of a website, if you don\u2019t have access to a higher resolution device. With DevTools, you have the ability to take a high resolution screenshot of either a full page, or a viewport right inside the browser without needing additional tools.<\/p>\n\n\n\n<p>In Chromium browsers:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>In DevTools, click the <strong>Toggle device toolbar<\/strong> icon (<code>Cmd+Shift+M<\/code> or <code>Ctrl+Shift+M<\/code>) to enter the responsive design mode.<\/li>\n\n\n\n<li>In the device toolbar, click <strong>More options<\/strong> (<code>\u22ee<\/code>) &gt; <strong>Add device pixel ratio<\/strong>. In the action bar at the top of the viewport, select a DPR value from the new DPR drop-down menu. Default is 2, but you can bump it upto 3!<\/li>\n\n\n\n<li>Click <strong>More options<\/strong> &gt; select <strong>Capture screenshot<\/strong> for viewport or <strong>Capture full size screenshot<\/strong> for the entire page.<\/li>\n<\/ol>\n\n\n\n\t\t<figure class=\"wp-block-jetpack-videopress jetpack-videopress-player\" style=\"\" >\n\t\t\t<div class=\"jetpack-videopress-player__wrapper\"> <iframe title=\"VideoPress Video Player\" aria-label='VideoPress Video Player' width='500' height='313' src='https:\/\/videopress.com\/embed\/HiKrsXnT?cover=1&amp;autoPlay=0&amp;controls=1&amp;loop=0&amp;muted=0&amp;persistVolume=1&amp;playsinline=0&amp;preloadContent=metadata&amp;useAverageColor=1&amp;hd=0' frameborder='0' allowfullscreen data-resize-to-parent=\"true\" allow='clipboard-write'><\/iframe><script src='https:\/\/v0.wordpress.com\/js\/next\/videopress-iframe.js?m=1674852142'><\/script><\/div>\n\t\t\t\n\t\t\t\n\t\t<\/figure>\n\t\t\n\n\n<p>In Firefox,<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Open the <strong>Console<\/strong> panel, run the command <code>:screenshot --dpr 3<\/code> to take a high definition screenshot of the page with the device pixel ratio set to 3.<\/li>\n\n\n\n<li>To capture a full page screenshot, just add <code>--fullpage<\/code> to the end and <code>--screenshot .header<\/code>  to capture a screenshot of a node that can be identified by a selector.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">7. Inspect Event streams<\/h2>\n\n\n\n<p>If your web app receives a stream of events from the server, dispatched using <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/Server-sent_events\/Using_server-sent_events\">Server-<\/a><a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/Server-sent_events\/Using_server-sent_events\">S<\/a><a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/Server-sent_events\/Using_server-sent_events\">ent Events<\/a>, then you would need the ability to inspect the incoming streams in the DevTools. SSE behaves a bit differently than the traditional request-response paradigm, hence, you will only see one request in the <strong>Network<\/strong> panel.<\/p>\n\n\n\n<p>In Chromium browsers, you can still inspect the incoming streams by opening the request, and navigate to the <strong>EventStream<\/strong> tab. Additionally, the EventStream tab also captures events sent by the server through XHR &amp; Fetch. Similar to the Network panel, you can also filter streams with regex or clear the entries in the table.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"624\" src=\"https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2024\/04\/s_52E2E38C42ACB86B87D3BFE6176695A8B39C9CD0BF6927AACEC92F6B0CF47034_1711646966082_image.png?resize=1024%2C624&#038;ssl=1\" alt=\"\" class=\"wp-image-1590\" srcset=\"https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2024\/04\/s_52E2E38C42ACB86B87D3BFE6176695A8B39C9CD0BF6927AACEC92F6B0CF47034_1711646966082_image.png?resize=1024%2C624&amp;ssl=1 1024w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2024\/04\/s_52E2E38C42ACB86B87D3BFE6176695A8B39C9CD0BF6927AACEC92F6B0CF47034_1711646966082_image.png?resize=300%2C183&amp;ssl=1 300w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2024\/04\/s_52E2E38C42ACB86B87D3BFE6176695A8B39C9CD0BF6927AACEC92F6B0CF47034_1711646966082_image.png?resize=768%2C468&amp;ssl=1 768w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2024\/04\/s_52E2E38C42ACB86B87D3BFE6176695A8B39C9CD0BF6927AACEC92F6B0CF47034_1711646966082_image.png?resize=1536%2C936&amp;ssl=1 1536w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2024\/04\/s_52E2E38C42ACB86B87D3BFE6176695A8B39C9CD0BF6927AACEC92F6B0CF47034_1711646966082_image.png?w=1680&amp;ssl=1 1680w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">8. View and Copy style changes<\/h2>\n\n\n\n<p>DevTools lets you easily tweak styles on a page and see the output live. But identifying all the modified styles and copying them back to the editor is tedious. If you ever find yourself in a situation, where you are constantly switching back and forth between your editor and the devtools to copy the style changes, there\u2019s an easier way to see what was changed, and copy the changes to your editor.<\/p>\n\n\n\n<p>In Firefox:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>In the <strong>Rules<\/strong> pane, apply changes to the CSS declarations, and then open the <strong>Changes<\/strong> tab to see the diff of all the styles changed. Click &#8220;Copy All Changes&#8221; button to copy the modified styles, with previous declaration automatically commented.<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"640\" src=\"https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2024\/04\/s_52E2E38C42ACB86B87D3BFE6176695A8B39C9CD0BF6927AACEC92F6B0CF47034_1711715537646_image.png?resize=1024%2C640&#038;ssl=1\" alt=\"\" class=\"wp-image-1591\" srcset=\"https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2024\/04\/s_52E2E38C42ACB86B87D3BFE6176695A8B39C9CD0BF6927AACEC92F6B0CF47034_1711715537646_image.png?resize=1024%2C640&amp;ssl=1 1024w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2024\/04\/s_52E2E38C42ACB86B87D3BFE6176695A8B39C9CD0BF6927AACEC92F6B0CF47034_1711715537646_image.png?resize=300%2C187&amp;ssl=1 300w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2024\/04\/s_52E2E38C42ACB86B87D3BFE6176695A8B39C9CD0BF6927AACEC92F6B0CF47034_1711715537646_image.png?resize=768%2C480&amp;ssl=1 768w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2024\/04\/s_52E2E38C42ACB86B87D3BFE6176695A8B39C9CD0BF6927AACEC92F6B0CF47034_1711715537646_image.png?resize=1536%2C959&amp;ssl=1 1536w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2024\/04\/s_52E2E38C42ACB86B87D3BFE6176695A8B39C9CD0BF6927AACEC92F6B0CF47034_1711715537646_image.png?w=1710&amp;ssl=1 1710w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><\/figure>\n\n\n\n<p>In Safari:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>In the <strong>Styles<\/strong> pane, apply changes to the CSS declarations, and then click on the <strong>Changes<\/strong> pane to see the diff.<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"640\" src=\"https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2024\/04\/s_52E2E38C42ACB86B87D3BFE6176695A8B39C9CD0BF6927AACEC92F6B0CF47034_1711715774786_image.png?resize=1024%2C640&#038;ssl=1\" alt=\"\" class=\"wp-image-1592\" srcset=\"https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2024\/04\/s_52E2E38C42ACB86B87D3BFE6176695A8B39C9CD0BF6927AACEC92F6B0CF47034_1711715774786_image.png?resize=1024%2C640&amp;ssl=1 1024w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2024\/04\/s_52E2E38C42ACB86B87D3BFE6176695A8B39C9CD0BF6927AACEC92F6B0CF47034_1711715774786_image.png?resize=300%2C187&amp;ssl=1 300w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2024\/04\/s_52E2E38C42ACB86B87D3BFE6176695A8B39C9CD0BF6927AACEC92F6B0CF47034_1711715774786_image.png?resize=768%2C480&amp;ssl=1 768w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2024\/04\/s_52E2E38C42ACB86B87D3BFE6176695A8B39C9CD0BF6927AACEC92F6B0CF47034_1711715774786_image.png?resize=1536%2C959&amp;ssl=1 1536w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2024\/04\/s_52E2E38C42ACB86B87D3BFE6176695A8B39C9CD0BF6927AACEC92F6B0CF47034_1711715774786_image.png?w=1710&amp;ssl=1 1710w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">9. Live expressions<\/h2>\n\n\n\n<p>If you are frequently entering the same JavaScript expression into the <strong>Console<\/strong>, you can simplify the workflow using the <strong>Live Expressions<\/strong>. Live Expressions works like the Watch feature from the debugger, that evaluates the expression in real-time as you interact with the web page.<\/p>\n\n\n\n<p>In Chromium browsers, click the eye icon in the Console to create a Live Expression. The Live Expression text box appears. Type your expression in the text box, and press <code>Enter<\/code>.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/paper-attachments.dropboxusercontent.com\/s_52E2E38C42ACB86B87D3BFE6176695A8B39C9CD0BF6927AACEC92F6B0CF47034_1711721042698_live-expressions.gif?ssl=1\" alt=\"GIF of live expressions watching the width and the height of the window as it changes\"\/><\/figure>\n\n\n\n<p>Live Expressions are pinned to the top of the Console. You can add multiple live expressions. It even allows multi-line expressions if you press <code>Shift+Enter<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">10. Debug horizontal scrollbars<\/h2>\n\n\n\n<p>Unwanted horizontal scrollbars is one of the most annoying issues to debug in frontend development, especially identifying the element that caused the overflow. Firefox and Polypane offers some unique ways to identify such elements on the page.<\/p>\n\n\n\n<p>In the Firefox\u2019s <strong>Inspector<\/strong> panel, elements that have scrollbars are identified with the <code>scroll<\/code> badge. Click the badge to highlight the elements that caused the container to have scrollbars, which are indicated with the <code>overflow<\/code> badge.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"792\" height=\"553\" src=\"https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2024\/04\/s_52E2E38C42ACB86B87D3BFE6176695A8B39C9CD0BF6927AACEC92F6B0CF47034_1712042483420_image.png?resize=792%2C553&#038;ssl=1\" alt=\"\" class=\"wp-image-1593\" srcset=\"https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2024\/04\/s_52E2E38C42ACB86B87D3BFE6176695A8B39C9CD0BF6927AACEC92F6B0CF47034_1712042483420_image.png?w=792&amp;ssl=1 792w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2024\/04\/s_52E2E38C42ACB86B87D3BFE6176695A8B39C9CD0BF6927AACEC92F6B0CF47034_1712042483420_image.png?resize=300%2C209&amp;ssl=1 300w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2024\/04\/s_52E2E38C42ACB86B87D3BFE6176695A8B39C9CD0BF6927AACEC92F6B0CF47034_1712042483420_image.png?resize=768%2C536&amp;ssl=1 768w\" sizes=\"auto, (max-width: 792px) 100vw, 792px\" \/><\/figure>\n\n\n\n<p><a href=\"https:\/\/polypane.app\/\">Polypane<\/a>, a browser based on Chromium automatically detects containers with horizontal scrollbars indicated by the overflow icon (<code>**\u2194**<\/code>). Clicking on the icon will activate the <a href=\"https:\/\/polypane.app\/docs\/layout-debugging\/\">layout debugging tool<\/a> which will highlight the element causing the overflow in red.<\/p>\n\n\n\n\t\t<figure class=\"wp-block-jetpack-videopress jetpack-videopress-player\" style=\"\" >\n\t\t\t<div class=\"jetpack-videopress-player__wrapper\"> <iframe title=\"VideoPress Video Player\" aria-label='VideoPress Video Player' width='500' height='282' src='https:\/\/videopress.com\/embed\/BjYL4b9J?cover=1&amp;autoPlay=0&amp;controls=1&amp;loop=0&amp;muted=0&amp;persistVolume=1&amp;playsinline=0&amp;preloadContent=metadata&amp;useAverageColor=1&amp;hd=0' frameborder='0' allowfullscreen data-resize-to-parent=\"true\" allow='clipboard-write'><\/iframe><script src='https:\/\/v0.wordpress.com\/js\/next\/videopress-iframe.js?m=1674852142'><\/script><\/div>\n\t\t\t\n\t\t\t\n\t\t<\/figure>\n\t\t\n\n\n<p>For more such insightful tips and tricks for the browser DevTools, watch out this space and the following resources curated by the web community:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/devtoolstips.org\/\">DevTools Tips<\/a> (Patrick Brosset): A curated collection of helpful cross-browser DevTools tips and tricks.<\/li>\n\n\n\n<li><a href=\"https:\/\/umaar.com\/dev-tips\/\">Dev Tips<\/a> (Umar Hansa): DevTools tips sent to your inbox!<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Front-end developers spend a significant amount of time working inside the browser\u2019s DevTools. Likely just as much as they spend time writing code in the code editor. However, most developers barely scratch the surface of what DevTools can accomplish. I have been curating a collection of DevTools tips across major browsers. The following are some [&hellip;]<\/p>\n","protected":false},"author":18,"featured_media":1598,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"sig_custom_text":"","sig_image_type":"featured-image","sig_custom_image":0,"sig_is_disabled":false,"inline_featured_image":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[65],"class_list":["post-1570","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog-post","tag-devtools"],"acf":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2024\/04\/tips-thumb.jpg?fit=1000%2C500&ssl=1","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/posts\/1570","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/users\/18"}],"replies":[{"embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/comments?post=1570"}],"version-history":[{"count":5,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/posts\/1570\/revisions"}],"predecessor-version":[{"id":1601,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/posts\/1570\/revisions\/1601"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/media\/1598"}],"wp:attachment":[{"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/media?parent=1570"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/categories?post=1570"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/tags?post=1570"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}