Danial Khakbaz's logo
Home
Projects
Experiences
Blog
Contact

Disable CORS on Chrome

Disable CORS on Chrome's Image
Danial Khakbaz's image

Danial Khakbaz

February 11, 2024

2 min read

As of Chrome 95, on MacOS and Windows, --disable-site-isolation-trials remains a required flag in order to disable web security, so the command-line arguments to Chrome seen below are still valid. (Some of the arguments are not formally supported by Chrome, as it will warn you.) To test whether you've successfully launched Chrome with web security disabled, run the snippet in Web Security Test at the bottom of this post.

The Solution

As of Chrome 81, it is mandatory to pass both --disable-site-isolation-trials and a non-empty profile path via --user-data-dir in order for --disable-web-security to take effect:

MacOS (in Terminal)

open -na Google\ Chrome --args --user-data-dir=/tmp/temporary-chrome-profile-dir --disable-web-security --disable-site-isolation-trials

Windows (from "Run" dialog [Windows+R] or start menu in Windows 8+)

chrome.exe --user-data-dir=\temporary-chrome-profile-dir --disable-web-security --disable-site-isolation-trials

It is likely that Chrome requires a non-empty profile path to mitigate the high security risk of launching the browser with web security disabled on the default profile. See --user-data-dir= vs --user-data-dir=/some/path for more details below.


Sources

©2024 Danial Khakbaz. All Rights Reserved.

Available for new projects