How to disable CORS in Chrome

You're testing a front end against an API that doesn't send CORS headers yet, and you just want Chrome to stop blocking it. You can — here's the exact command for each system — but read the warning, and consider the narrower options below it.

On this page
  1. Start Chrome with web security off
  2. Why it needs a separate profile
  3. Narrower: allow CORS for one site only
  4. Better: a dev-server proxy
  5. The real fix

Start Chrome with web security off

Close nothing — this starts a second, separate Chrome. The --user-data-dir part is required; without a separate profile Chrome ignores the flag.

Windows

"C:\Program Files\Google\Chrome\Application\chrome.exe" --disable-web-security --user-data-dir="%TEMP%\chrome-dev"

Mac

open -na "Google Chrome" --args --disable-web-security --user-data-dir=/tmp/chrome-dev

Linux

google-chrome --disable-web-security --user-data-dir=/tmp/chrome-dev

Chrome shows a yellow bar saying you're using an unsupported command-line flag. That's how you know it worked.

Why it needs a separate profile

The flag doesn't just switch off CORS for your API. It turns off the same-origin policy for every site in that window — so any page open there could read responses from any other site, including ones you are signed in to. That's why Chrome insists on a separate profile.

Use that window for your dev site only. Don't sign in to email, banking or anything else in it, and close it when you're done.

Narrower: allow CORS for one site only

Instead of turning off security everywhere, you can add the missing Access-Control-Allow-* headers to responses from just the API you're testing, in your normal browser. Everything else keeps working as usual.

Two limits apply to any tool that does this:

HeaderForge (Chrome, free)

Allow CORS for one site in one click, as a single switch you can turn off again. When a request on the current tab is blocked for CORS reasons, HeaderForge names the server that refused it and offers the fix right there — and says so plainly when the failure is a rejected preflight that headers can't fix. No account, no tracking.

Get HeaderForge for Chrome

Better: a dev-server proxy

Route API calls through your own dev server so the browser only ever talks to one origin. No CORS involved at all:

// vite.config.js
export default {
  server: { proxy: { "/api": "http://localhost:8080" } }
};

Then call fetch("/api/users") instead of the full URL. webpack-dev-server and Next.js rewrites do the same job.

The real fix

Everything above only helps you. For your users, the API has to send the headers. CORS error: what it means and how to fix it has the server code, and the CORS tester shows exactly what a given request gets back.

More on this topic: How to disable CORS in Firefox (and why content.cors.disable makes it worse) · TypeError: Failed to fetch — what it actually means, and how to tell which cause · net::ERR_BLOCKED_BY_CLIENT, ERR_BLOCKED_BY_RESPONSE and ERR_BLOCKED_BY_ORB · “Has been blocked by CORS policy”: every variant and its fix