Skip to content

Allow or Block JavaScript in Chrome on the Computer

Blocking JavaScript can tame a misbehaving site, but a global block also breaks forms, menus, and media controls. Chrome lets you keep the default on and make exceptions for one domain at a time.

Open Chrome's JavaScript settings, set the top switch, then add or remove site exceptions. If a page still fails, check the blocked domain list before you change cookies or extensions.

In this guide, I have covered:

Watch the JavaScript Setting in Action

Not sure which switch to look for? This short video shows where Chrome keeps the JavaScript permission on a computer.

The video may show older labels. Match what you see in Chrome to the current names in the sections below.

How Chrome’s JavaScript Permission Works

Chrome allows JavaScript unless you tell it otherwise, so most pages work the moment you open them. The top switch sets the default for every site that has no exception.

A domain listed under Sites allowed to use JavaScript or Not allowed to use JavaScript overrides that default. Recent desktop builds label the top switch Sites can use JavaScript and Don’t allow sites to use JavaScript. Older guides may say Allow and Block.

Google’s Chrome Help page on JavaScript settings is a useful reference when a label in your version differs.

note icon

A site in either exception list wins over the top switch. If one page ignores the global setting, check Customized behaviors before you change anything else.

Block JavaScript for All Sites

Sometimes you need to see how a page behaves without scripts. Use the global block for that kind of test, not as a permanent browsing habit.

A global block stops forms, menus, media controls, and other interactive features on every site that is not in the allowed list.

If your real goal is to reduce ads rather than disable site scripts, see 10+ Best Ad Block Extensions for Google Chrome before changing this setting.

  1. Open Google Chrome on your computer.
  2. Click the vertical 3-dots icon menu and select Settings.
  3. In the left sidebar, select Privacy and security.
  4. Select Site settings.
  5. Under Content, select JavaScript.
  6. Turn the top toggle off until it reads Don’t allow sites to use JavaScript.
  7. Reload any open pages that need the new setting.

After the reload, script-driven elements should stop working on sites with no exception. A site in the allowed list can keep working.

Allow JavaScript for All Sites

A page that loads but won’t let you click, type, or play anything often needs JavaScript. Turn the global permission back on when that happens.

  1. Open Google Chrome on your computer.
  2. Click the vertical 3-dots icon menu and select Settings.
  3. In the left sidebar, select Privacy and security.
  4. Select Site settings.
  5. Under Content, select JavaScript.
  6. Turn the top toggle on until it reads Sites can use JavaScript.
  7. Reload the affected website.

After the reload, the missing controls or content should return. If the site still fails, check the exception list before you change any other setting.

Allow JavaScript on a Specific Site

You have one trusted site that needs scripts, and you don’t want to loosen the setting for every other site. That’s what the per-site allow list is for.

  1. Click the three-dot menu vertical 3-dots icon at the top right of Chrome and choose Settings.
  2. Select Privacy and security in the left sidebar.
  3. Click Site settings.
  4. Scroll to the Content section and click JavaScript.
  5. Confirm the top toggle reads Sites can use JavaScript. If it says Don't allow sites to use JavaScript, click it to turn JavaScript on.
  6. Under Customized behaviors, check the Not allowed to use JavaScript list for discord.com.
  7. If discord.com is there, click the three-dot vertical 3-dots icon next to it and choose Remove.
  8. (Optional) Click Add next to Sites allowed to use JavaScript, type discord.com, and click Add to whitelist it.

You’ll know it worked when the page’s interactive content loads after a reload. If not, confirm the top switch is on and the domain is not still in the blocked list.

Block JavaScript for One Website

One site is acting up, but the rest of your browsing is fine. Block scripts for that domain only.

  1. Open Google Chrome on your computer.
  2. Click the vertical 3-dots icon menu and select Settings.
  3. In the left sidebar, select Privacy and security.
  4. Select Site settings.
  5. Under Content, select JavaScript.
  6. In Customized behaviors, select Not allowed to use JavaScript.
  7. Click Add.
  8. Type the site’s domain, such as example.com.
  9. Click Add to save the exception.
  10. Reload the website.

After the reload, that site’s interactive content should stop. Other sites keep their own permissions.

Remove a JavaScript Block for One Site

A site can stay broken even when the top switch is on. The domain may still be sitting in Chrome’s blocked exception list.

  1. Open a new Chrome tab.
  2. Type chrome://settings/content/javascript in the address bar.
  3. Press Enter.
  4. Under Customized behaviors, open Not allowed to use JavaScript.
  5. Find the site’s domain in the list.
  6. Click the vertical 3-dots icon menu beside the site.
  7. Select Remove.
  8. Reload the website.

The domain should disappear from the blocked list, and the page should behave normally after a reload.

JavaScript and cookies are separate permissions. If the missing feature is a sign-in, shopping cart, or personalized content rather than an interactive control, review Block or Allow Browser Cookies in Chrome on the Computer before changing the script setting.

Chrome also keeps site permissions separately on Android. You can allow or block JavaScript in Chrome browser on Android when you need the mobile steps.

Frequently Asked Questions

If a page still refuses to work, the answer is usually in the exception list. The questions below cover the common cases.

Is JavaScript enabled by default in Chrome on a computer?

Yes. Chrome normally allows JavaScript. The top setting reads Sites can use JavaScript, while a domain under Not allowed to use JavaScript remains blocked.

Can I allow JavaScript for just one website?

Yes. Add the domain to Sites allowed to use JavaScript under Customized behaviors. That exception can allow the site even when the global default is blocked.

How do I block JavaScript on one site without blocking it everywhere?

Add the domain under Not allowed to use JavaScript. Keep the top setting on Sites can use JavaScript, and Chrome will apply the block only to that domain.

Why does a website still not work after I allow JavaScript?

It may still be listed under Not allowed to use JavaScript, or the missing feature may depend on cookies or another permission. Remove the JavaScript block, reload the page, and check the relevant site permission separately.

When should I block JavaScript for every site?

Use the global block as a short test when a page behaves better without scripts, then switch it back on. Per-site exceptions cause fewer broken pages because most websites rely on JavaScript for basic controls.

Please share the article if you find it helpful:

Disclosure: This page may contain affiliate links, which means we may receive compensation for your purchases; of course at no extra cost to you (indeed, you may get special discounts).
Kushal Azza

Kushal Azza

Kushal Azza has worked in digital analytics for 14 years. He co-founded SolvyOne Digital and is building WPAQ.com, a website audit tool. He writes about measurement, AI, workflows and building products. Follow him on X/Twitter and LinkedIn.

2 comments and feedback

Leave a thought or feedback

Please leave a descriptive comment or feedback with your real name. Our human moderator vets every comment, and it may take 24 to 48 hours to get published or rejected.
Your email address will not be published, and we will never spam your inbox. Required fields are marked *