Skip to content

Instantly share code, notes, and snippets.

@ABHISHEK-KEDAR-21
Forked from jmonterroso/chrome-no-cors.md
Last active October 8, 2020 13:14
Show Gist options
  • Save ABHISHEK-KEDAR-21/1c1df9bc26e36587376ad53629141ce1 to your computer and use it in GitHub Desktop.
Save ABHISHEK-KEDAR-21/1c1df9bc26e36587376ad53629141ce1 to your computer and use it in GitHub Desktop.
Open Chrome without CORS restriction

For OSX, open Terminal and run:

$ open -a Google\ Chrome --args --disable-web-security For Linux run:

$ google-chrome --disable-web-security

Also if you're trying to access local files for dev purposes like AJAX or JSON, you can use this flag too.

-–allow-file-access-from-files

For PC go into the command prompt and go into the folder where Chrome.exe is and type chrome.exe --disable-web-security

That should disable the same origin policy and allow you to access local files. Update: For Chrome 22+ you will be presented with an error message that says:

You are using an unsupported command-line flag: --disable-web-security. Stability and security will suffer. However you can just ignore that message while developing.

pkill chrome

google-chrome --disable-web-security --user-data-dir="/home/abhishek/code_workspace/chrome-cors" -–allow-file-access-from-files

chrome://flags/#unsafely-treat-insecure-origin-as-secure

To treat localhost as https

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment