>It works by saving a copy of the page you're working on (or any other resource, like a JavaScript or CSS file), letting you edit that, and then serving that file instead of the live version.<p>1. You can already set up a local host on your machine to run tests. I thought that was standard practice.<p>2. I'm glad browsers are offering a similar solution which is easier to set up and useful for front end work. I just checked to see if Firefox has similar functionality, and it seems they support diffs for CSS only, but there is an add-on called Resource Override that appears to have similar functionality.
Local overrides are super useful for testing site speed:<p>• Your local setup is likely different from production (not serving from production domains, not using image resize services, using different HTTP compression...)<p>• You might not be able to run tests on localhost, e.g. if you're an external consultant or working in technical SEO (who often want to give specific recommendations to devs as dev attention is scarce and expensive)<p>There are still some limitations of testing changes in DevTools:<p>• Testing a fresh load is a pain (need to clear OS-level DNS cache, need to clear the connection cache in Chrome, need to clear cookies/service worker)<p>• DevTools throttling doesn't represent server connections accurately (you need to throttle at the OS level for accurate data, which slows down your whole computer and requires admin rights)<p>WebPageTest [1] and my own tool DebugBear [2] now support experiments to make it easy to try out content changes in a controlled lab environment.<p>[1] <a href="https://product.webpagetest.org/experiments" rel="nofollow noreferrer">https://product.webpagetest.org/experiments</a>
[2] <a href="https://www.debugbear.com/docs/experiments" rel="nofollow noreferrer">https://www.debugbear.com/docs/experiments</a>
I love using chrome overrides to test if a front-end bug is fixed on production data! The feedback is immediate and I feel more confident with a PR.<p>It works well for me since I'm not allowed to export the production data onto my machine or testing environments for HIPPA reasons.<p>This is way better than reviewing an exception from obfuscated javascript (without sourcemaps) and trying to figure out where it occurred.
Ok - I think this article pitches the wrong thing (or at least buries the lede).<p>I think the key point is that by using overrides, he can basically implement a deployed change that uses production data, but without having any access or control over production infrastructure, and with no risk for other users.<p>Lots of folks have correctly pointed out that running locally is essentially a solved problem. He can do it against prod data, because he's overriding the prod configuration.<p>I've done exactly this for non-browser (and some browser) applications before (using local MITM proxies) but it's nifty that chrome lets you skip the certificate headaches and just loads a resource from disk.
The snippet for fetching performance numbers is useful but it's cargo culting (ie, using incorrectly and needlessly) Number.EPSILON [1], besides not using the built in toFixed(2)<p>How universal is the drive to try to keep others from making needless mistakes?<p>[1] "FCP is " +Math.round((fcp + Number.EPSILON) * 100) / 100
I have coworkers who only use 2 of chromes debugging tools: the console and the network tab. They dont know about breakpoints, mapped typescript/react files, or local overrides. Every time they come to me with some issue they're facing, I have them set up breakpoints first before we do anything. Usually that's all that we need to do, and we figure out the problem in about 5mins