How to Pause JavaScript – Chrome

When you are developing a website, sometimes you just need to pause JavaScript so that you can work on something. There’s nothing more annoying than that stupid image slider that just won’t sit still long enough for you to troubleshoot it.

But how do we pause JavaScript? Internet trolls and people who don’t know any better will tell you to go to the developer tools window, Sources, and then click the pause button which will supposedly “Pause script execution”. And it does! But at a terrible cost… For reasons that are completely unclear to me, it also essentially “locks” the page from doing anything, and you are unable to even manipulate the code like you normally would be able to. This, of course, completely defeats the purpose of pausing it in the first place.

So what should we do? Let me show you!

How to Properly Pause JavaScript

This will allow us to pause the scripts and work on the site at the same time.

  1. Open up the Developer Tools (F12 or right click somewhere blank and click “inspect”)
  2. Click the three little dots in the top right corner, and then click settings (or just press F1 with the Developer Tools window selected)
  3. Check “Disable JavaScript”

That’s it! You would think that disabling JavaScript would prevent things from loading to begin with, but as long as it’s allowed to run when the page is opened, it just prevents it from continuing to run when you’re on the page! You should even be able to re-check it later to get it working again.

This method allows you to continue working on the page and prevents JavaScript from moving things around! It’s the best of both worlds. It took me a while to figure this trick out and I spent years being frustrated before I got it working. Never did figure out why on earth the regular “Pause script execution” button locks everything else, but this does exactly what you’re looking for.

Good luck!

About Brian Johnson

Brian Johnson is a website developer and designer living in Minneapolis, Minnesota with a passion for code and WordPress. He spends his days building WordPress websites for small businesses, developing new code with the online community, and living life.