How to disable web security in a chrome browser

Lois Onyinyemme Bassey
2 min readSep 18, 2019

Web security can be pretty annoying especially when you are trying to perform simple API requests, CORS (Cross Origin Resource Sharing) can be an issue especially when the website you are making the API request from is not listed as part of the sites that can access the API.

What I meant is this

This allows only the website with the url: http://origin-domain.com to access the API

So, if it does happen that you want to access the above api but are not coming from this url: http://origin-domain.com, you can still access it by DISABLING WEB SECURITY in your browser (e.g chrome)

That’s pretty cool right? Please note that this method is not safe as it exposes whatever information you input into the browser to hackers, but for testing purposes, you are good to go.

So, lets begin: (For windows users)

Perform the following command “WINDOWS + R” and click on the “OK” button, or you can open your system’s command prompt using however method you choose

Click on the OK button to open command prompt

Once command prompt opens up, type in the following command:

”C:\Program Files (x86)\Google\Chrome\Application\chrome.exe” — disable-web-security — disable-gpu — user-data-dir=~/chromeTemp

Press the enter key to run the command

This will open up an instance of your chrome web browser but with web security disabled in it. It should look like this

As seen above, web security has been disabled in this instance of the chrome browser

Voila! You are good to go in testing your code with that API that’s acting up cause of CORS policy. Hope you enjoyed this article, if yes, hit that clap button! Thanks do have a nice day.

--

--