How to Bypass CORS Policy for Locally Hosted Domains in Chrome

In certain scenarios, users may encounter a CORS policy error that prevents access to their locally hosted website. This issue is specific to Google Chrome, as other browsers have not yet implemented this policy.

Solution

Disabling Insecure Private Network Requests

  • Open a New Tab in Google Chrome:
  • Launch the browser and open a new tab.
  • Access Chrome Flags:
  • In the search bar, type: chrome://flags/#block-insecure-private-network-requests
  • Modify the Setting:
  • Locate the Block insecure private network requests option.
  • Click the drop-down menu next to it and select Disabled.
  • Restart the Browser:
  • Close Google Chrome completely and reopen it to apply the changes.

Leave a comment

Your email address will not be published. Required fields are marked *