Set Google Chrome's disable-web-security flag in JavaScript

Running my application in chrome gives me the following error:

XMLHttpRequest cannot load file:///D:/Nancy/Nancy_16Jul/Nancy.Rest.Client/Assets/Templates/Login.htm. Origin null is not allowed by Access-Control-Allow-Origin.

If I run the application by disabling the web security it works fine. But I want to set the web security through code. Is it possible to do so?

Upvotes: 0

Views: 758

Answers (1)

user149341
user149341

Reputation:

No, of course not. If a site could just turn off web security, that'd make the security pretty worthless!

Upvotes: 1

Related Questions