visit
Fig. 1 A preflight request error on the console.
You’ve probably scoured the internet & found possible solutions to the problem only to find out they don’t work for you. For instance, you may have done these:- Enabled Google Chrome CORS extension- Disabled web security of the browser by changing the file path in the Target property- Installed CORS package & re-writing your JavaScript code to suit it- Endless changing of the specific API you’d use- Changing the API endpoints endlessly too- A rabbit hole of more readings, forum discussions & videosIf this sounds like you, then you’re reading the right article!This article will delve into a simple & temporary fix for this problem. You will need:- Windows OS (I’m sure the steps may be similar for other OS but uses OS specific commands)- Windows Command Prompt (CMD)- This list ofFig. 2 The Windows CMD
Fig. 3 Navigate to C:// drive using the cd command
1st file path: C:\Program Files (x86)\Google\Chrome\Application
2nd file path: C:\Program Files\Google\Chrome\Application
On my machine, it exists in the 1st file path as seen below.
Fig. 4 Navigate to the folder where chrome.exe is using the cd command. dir command is to list all files & folders in the current directory you’re in
Command: chrome.exe --user-data-dir=”C:/Chrome dev session” --disable-web-security
It simply creates a new unsecured window (instance) for Google Chrome.Rest assured that only this newly created instance/window of Chrome is unsecured. Any other open windows of Chrome are still secure & not affected by this disabling.Fig 5 Using the command in the prompt automatically creates a new unsecured window for Chrome. This doesn’t affect all other open Chrome browsers.
Fig 6 The newly created window. Notice in the red border that it notifies you that it’s an unsecure instance