My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more
How to disable web security in a chrome browser

How to disable web security in a chrome browser

Lois Bassey's photo
Lois Bassey
·Aug 6, 2021·

2 min read

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

1_ZruHf8dqdmgtrY10BI69yw.png

So, if it does happen that you want to access the above api but are not coming from this url: 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

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

1_V1dGfJpM_c9cO5976BroKQ.png

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

1_9j4DbK2tM5MD4UrD1lrQew.png

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 like button! Thanks do have a nice day.