How to Disable CORS Policy in Microsoft Edge? Easy Steps
The CORS policy, also known as Cross-Origin Resource Sharing, is a security feature built into modern web browsers like Microsoft Edge. It prevents unauthorized communication between different websites or domains. While this protection is essential for keeping users safe from malicious attacks, it can sometimes create issues for developers who need to test APIs or work with resources across different origins.
If you are a developer or a tech enthusiast trying to test web applications locally, you might encounter CORS-related errors that block your requests. In such cases, temporarily disabling the CORS policy in Microsoft Edge can help you proceed with testing and debugging.
This guide will walk you through the complete process in a simple, step-by-step manner. You will also understand how CORS works and when it is safe to disable it.
Use of CORS Policy in Microsoft Edge
Before disabling CORS, it is important to understand that this policy exists for a reason. It protects users from attacks such as cross-site scripting and data theft. When you disable CORS, you are essentially removing a layer of browser security.
That said, developers often need to bypass CORS restrictions when working with local servers, APIs, or testing environments where proper headers are not configured yet.
In Microsoft Edge, there is no built-in toggle button to disable CORS. Instead, you need to launch the browser using a special command that disables web security features.
This method ensures that your main browser profile remains unaffected while allowing you to test your application in a separate session.
How to Disable CORS Policy in Microsoft Edge?

To disable the CORS policy in Microsoft Edge, you need to launch the browser with special command-line flags such as –disable-web-security and –user-data-dir. This temporarily turns off the browser’s security restrictions, allowing cross-origin requests. This method is mainly used for development and testing purposes and should not be used for regular browsing.
Follow the steps below carefully.
Step 1: Close All Running Instances of Microsoft Edge
Before making any changes, ensure that all open windows of Microsoft Edge are completely closed. This is necessary because the command you will run in later steps will not work if an instance of the browser is already active.
You can manually close all tabs and windows, or you can open the Task Manager on your Windows computer and end any remaining Edge processes. This guarantees a clean start for the modified browser session.
Taking this step seriously prevents conflicts and ensures that the new settings are applied correctly.
Step 2: Open Command Prompt or Run Dialog
Next, you need to open a tool that allows you to run system commands. You can use either the Command Prompt or the Run dialog box.
To open the Run dialog, press Windows + R on your keyboard. Alternatively, you can search for Command Prompt in the Start menu and open it.
These tools allow you to launch Microsoft Edge with custom parameters, which is the key to disabling the CORS policy.
Step 3: Locate the Microsoft Edge Installation Path
In order to run Microsoft Edge with special flags, you need to know its installation path.
On most Windows systems, the default location is:
C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe
If your Edge browser is installed in a different location, you can find it by right-clicking on the Edge shortcut, selecting Properties, and checking the Target field.
Copy the full path of the executable file, as you will need it in the next step.
Step 4: Run Microsoft Edge with Disabled Web Security
Now comes the most important step. You need to run Microsoft Edge with specific command-line arguments that disable the CORS policy.
In the Command Prompt or Run dialog, enter the following command:
“C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe” –disable-web-security –user-data-dir=”C:\temp-edge”
This command does two important things. The –disable-web-security flag disables the browser’s security features, including CORS. The –user-data-dir flag creates a temporary user profile so your main browser data remains safe.
After entering the command, press Enter. A new Microsoft Edge window will open with CORS disabled.
It is important to understand that this session is separate from your regular browsing session.
Step 5: Verify That CORS Is Disabled
Once the browser launches, you can verify whether the CORS policy is disabled.
Open the Developer Tools by pressing F12 and navigate to the Console tab. Try making a cross-origin request that previously failed.
If the request succeeds without any CORS error messages, it means the policy has been successfully disabled.
This confirmation step ensures that your setup is working correctly and you can proceed with your development tasks.
Step 6: Use This Mode Only for Testing
While it might be tempting to keep using this mode, it is strictly meant for development and testing purposes only.
Disabling CORS removes critical browser protections, making your system vulnerable to malicious scripts and data leaks. Always use this setup in a controlled environment and avoid visiting unknown or untrusted websites.
Once your testing is complete, close the browser window to restore normal security settings.
Step 7: Restart Microsoft Edge Normally
After finishing your work, simply close the modified Edge window and open Microsoft Edge normally from the Start menu or desktop shortcut.
When launched this way, the browser will operate with all security features enabled, including the CORS policy.
This step ensures that your everyday browsing remains safe and secure.
FAQs
What is CORS in Microsoft Edge?
CORS, or Cross-Origin Resource Sharing, is a browser security feature that controls how resources on one domain can be requested from another domain. It prevents unauthorized data access and protects users from security threats.
Is it safe to disable the CORS policy?
Disabling CORS is not safe for regular browsing. It removes important security protections. However, it can be used temporarily in a controlled environment for development and testing purposes.
Why do developers disable CORS?
Developers disable CORS to test APIs, debug applications, or work with local servers where proper CORS headers are not configured yet.
Can I disable CORS permanently in Microsoft Edge?
There is no permanent setting to disable CORS in Microsoft Edge. You must use command-line flags each time you want to launch the browser with CORS disabled.
Does disabling CORS affect all websites?
Yes, when you disable CORS using the command-line method, it affects all websites opened in that specific browser session.
Is there an alternative to disabling CORS?
Yes, instead of disabling CORS, you can configure your server to send proper CORS headers. This is the recommended and secure approach for handling cross-origin requests.
